Skip to content

sco_storage_v1.query

Prepares one statement as exec does and opens a cursor before its first row. Close it when done. SCO_TOO_MANY: SCO_STORAGE_MAX_CURSORS already open. out_cursor initialized to 0 before validation; caller must close cursor even after end-of-rows.

sco_result (*)(sco_plugin *, const char *, const sco_sql_value *, uint32_t, uint64_t *)

Service index

Property Value
Symbol sco_storage_v1.query
Record ID sco-storage-v1-query
Service sco.storage
Table sco_storage_v1
Version macro SCO_STORAGE_VERSION_1_0
Packed table version 65536
Since / availability size >= 80; 1.0
Complete member extent (x64 bytes) 80
Table size (x64 bytes) 128

Header source

sco_result (*query)(sco_plugin* self, const char* sql, const sco_sql_value* params, uint32_t nparams, uint64_t* out_cursor);
Prepares one statement as exec does and opens a cursor before its first row. Close it when done. SCO_TOO_MANY: SCO_STORAGE_MAX_CURSORS already open. out_cursor initialized to 0 before validation; caller must close cursor even after end-of-rows.

Absent table: query_service NOT_FOUND. Stopped: UNAVAILABLE; invalid/released self: BAD_ARG. Allocation exceptions: TOO_MANY; database errors may be FAILED. Additional failures/output state unspecified unless described in the buffer contract.

Absent table: query_service NOT_FOUND.

Host-owned cursor ID; close when done. SQL/parameters copied during call, TEXT needs no NUL; no SQLite memory crosses ABI.

Any thread; calls serialize per plugin. Same-call recursive reentrancy unspecified.

unspecified

unspecified

No cancellation entrypoint; ordinary unload/non-retained crash cleanup rolls back transaction and closes cursors/database. Retained-provider faults skip owner resource-release hooks and require restart; backing resources remain retained, not safe for cached calls.

Status labels are copied verbatim from the catalogue: direct is native access; typed-wrapper is wrapper-backed; restricted is a subset/adaptation; unsupported means no supported route is established. No status implies universal safety.

Language Catalogue status Source evidence / wrapper tokens
c direct include/sco_storage.h
(*query)
cpp typed-wrapper include/scosdk/storage.hpp
c.r_ = t_->query(self_, sql, params.size() ? params.begin() : nullptr, static_cast<uint32_t>(params.size()), &id);
csharp typed-wrapper sdk/csharp/Sco.Sdk/Storage.cs
r = _t->query(Self, s, block.Values, block.Count, &id);
lua restricted plugins/lua/sco_lua.c
sco_result r = st->query(s->self, sql, n ? params : NULL, n, &c->id);
sdk/docs/lua.md
Cursors are the runtime’s: sql closes its cursor on every path

open SQL cursor This is a search phrase for the existing contract, not an additional API alias.

ABI pins prove layout, not semantic behavior or a live game session.