MCPcopy Create free account
hub / github.com/IceClusters/icmysql / AddMethod

Function AddMethod

src/db/Query.js:111–127  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

109}
110
111function AddMethod(type) {
112 const method = async function(dbId, query, values, callback, cache) {
113 ScheduleResourceTick(global.resourceName)
114 const data = await ParseArgs(dbId, query, values, callback, cache);
115 if (data == null) return null;
116 ExecuteQuery(type, data.dbId, data.query, data.values, data.callback, data.cache);
117 }
118 const awaitMethod = async function(dbId, query, values, cache) {
119 ScheduleResourceTick(global.resourceName)
120 const data = await ParseArgs(dbId, query, values, null, cache);
121 if (data == null) return null;
122 // const invokingResource = GetInvokingResource();
123 return await ExecuteQuery(type, data.dbId, data.query, data.values, data.cache);
124 }
125 AddExport(type, method);
126 AddExport(`Await${type}`, awaitMethod);
127}
128
129for(type in queryTypes) {
130 AddMethod(queryTypes[type]);

Callers 1

Query.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected