MCPcopy Create free account
hub / github.com/denodrivers/postgres / templateStringToQuery

Function templateStringToQuery

query/query.ts:65–75  ·  view source on GitHub ↗
(
  template: TemplateStringsArray,
  args: unknown[],
  result_type: T,
)

Source from the content-addressed store, hash-verified

63 * ```
64 */
65export function templateStringToQuery<T extends ResultType>(
66 template: TemplateStringsArray,
67 args: unknown[],
68 result_type: T,
69): Query<T> {
70 const text = template.reduce((curr, next, index) => {
71 return `${curr}$${index}${next}`;
72 });
73
74 return new Query(text, result_type, args);
75}
76
77function objectQueryToQueryArgs(
78 query: string,

Callers 4

queryArrayFunction · 0.90
queryObjectFunction · 0.90
queryArrayMethod · 0.90
queryObjectMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected