MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / shellModuleSchema

Function shellModuleSchema

modules/dasSQLITE/sqlite/shell.c:1066–1081  ·  view source on GitHub ↗

** SQL function: shell_module_schema(X) ** ** Return a fake schema for the table-valued function or eponymous virtual ** table X. */

Source from the content-addressed store, hash-verified

1064** table X.
1065*/
1066static void shellModuleSchema(
1067 sqlite3_context *pCtx,
1068 int nVal,
1069 sqlite3_value **apVal
1070){
1071 const char *zName;
1072 char *zFake;
1073 UNUSED_PARAMETER(nVal);
1074 zName = (const char*)sqlite3_value_text(apVal[0]);
1075 zFake = zName? shellFakeSchema(sqlite3_context_db_handle(pCtx), 0, zName) : 0;
1076 if( zFake ){
1077 sqlite3_result_text(pCtx, sqlite3_mprintf("/* %s */", zFake),
1078 -1, sqlite3_free);
1079 free(zFake);
1080 }
1081}
1082
1083/*
1084** SQL function: shell_add_schema(S,X)

Callers

nothing calls this directly

Calls 2

shellFakeSchemaFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected