MCPcopy Create free account
hub / github.com/TanStack/db / getOpName

Function getOpName

packages/electric-db-collection/src/sql-compiler.ts:403–433  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

401}
402
403function getOpName(name: string): string {
404 const opNames = {
405 eq: `=`,
406 gt: `>`,
407 gte: `>=`,
408 lt: `<`,
409 lte: `<=`,
410 add: `+`,
411 and: `AND`,
412 or: `OR`,
413 not: `NOT`,
414 isUndefined: `IS NULL`,
415 isNull: `IS NULL`,
416 in: `= ANY`, // Use = ANY syntax for array parameters
417 like: `LIKE`,
418 ilike: `ILIKE`,
419 upper: `UPPER`,
420 lower: `LOWER`,
421 length: `LENGTH`,
422 concat: `CONCAT`,
423 coalesce: `COALESCE`,
424 }
425
426 const opName = opNames[name as keyof typeof opNames]
427
428 if (!opName) {
429 throw new Error(`Unknown operator/function: ${name}`)
430 }
431
432 return opName
433}

Callers 1

compileFunctionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected