MCPcopy Index your code
hub / github.com/questdb/questdb / parseVarcharArray

Method parseVarcharArray

compat/src/test/nodejs-postgres/runner.js:26–62  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

24 }
25
26 parseVarcharArray(input) {
27 const result = [];
28 let i = 0;
29
30 while (i < input.length) {
31 while (i < input.length && (input[i] === ' ' || input[i] === ',')) {
32 i++;
33 }
34
35 if (i >= input.length) break;
36
37 if (input[i] === '"') {
38 i++;
39 let value = '';
40 while (i < input.length && input[i] !== '"') {
41 value += input[i];
42 i++;
43 }
44 i++;
45 result.push(value);
46 } else {
47 let value = '';
48 while (i < input.length && input[i] !== ',') {
49 value += input[i];
50 i++;
51 }
52 const trimmed = value.trim();
53 if (trimmed.toLowerCase() === 'null') {
54 result.push(null);
55 } else if (trimmed) {
56 result.push(trimmed);
57 }
58 }
59 }
60
61 return result;
62 }
63
64 async executeQuery(sql, query, parameters = []) {
65 try {

Callers

nothing calls this directly

Calls 3

toLowerCaseMethod · 0.80
pushMethod · 0.65
trimMethod · 0.45

Tested by

no test coverage detected