MCPcopy Create free account
hub / github.com/documentdb/documentdb / FormatSqlQuery

Function FormatSqlQuery

pg_documentdb/include/utils/query_utils.h:122–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 * return s->data;
121 */
122pg_attribute_printf(1, 2) inline static const char *
123FormatSqlQuery(const char *queryFormat, ...)
124{
125 StringInfoData cmdbuf;
126
127 initStringInfo(&cmdbuf);
128 for (;;)
129 {
130 va_list args;
131 int needed;
132
133 va_start(args, queryFormat);
134 needed = appendStringInfoVA(&cmdbuf, queryFormat, args);
135 va_end(args);
136 if (needed == 0)
137 {
138 break; /* success */
139 }
140 enlargeStringInfo(&cmdbuf, needed);
141 }
142
143 return cmdbuf.data;
144}
145
146#endif

Calls

no outgoing calls

Tested by

no test coverage detected