gdDocumentation0.8.0

API reference

GDDatabaseTx

Dedicated client holding one physical connection until the transaction ends.

Methods

query

query(sql: String, args: Array = []) -> Dictionary, Err

Return the completion signal without waiting, for composition.

Parameters

NameTypeDefaultDescription
sqlStringRequiredSQL statement; bind external values through the separate parameter array.
argsArray[]Arguments in call or parameter-binding order.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

query_async

query_async(sql: String, args: Array = []) -> await Dictionary, Err

Return the completion signal without waiting, for composition.

Parameters

NameTypeDefaultDescription
sqlStringRequiredSQL statement; bind external values through the separate parameter array.
argsArray[]Arguments in call or parameter-binding order.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

query_row

query_row(sql: String, args: Array = []) -> Dictionary, Err

Return query_row's completion signal without waiting, for composition.

Parameters

NameTypeDefaultDescription
sqlStringRequiredSQL statement; bind external values through the separate parameter array.
argsArray[]Arguments in call or parameter-binding order.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

query_row_async

query_row_async(sql: String, args: Array = []) -> await Dictionary, Err

Return query_row's completion signal without waiting, for composition.

Parameters

NameTypeDefaultDescription
sqlStringRequiredSQL statement; bind external values through the separate parameter array.
argsArray[]Arguments in call or parameter-binding order.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

query_rows

query_rows(sql: String, args: Array = []) -> GDDatabaseRows, Err

Return query_rows' completion signal without waiting, for composition.

Parameters

NameTypeDefaultDescription
sqlStringRequiredSQL statement; bind external values through the separate parameter array.
argsArray[]Arguments in call or parameter-binding order.

Return value

GDDatabaseRows, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

query_rows_async

query_rows_async(sql: String, args: Array = []) -> await GDDatabaseRows, Err

Return query_rows' completion signal without waiting, for composition.

Parameters

NameTypeDefaultDescription
sqlStringRequiredSQL statement; bind external values through the separate parameter array.
argsArray[]Arguments in call or parameter-binding order.

Return value

await GDDatabaseRows, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

is_active

is_active() -> bool

Check whether the transaction remains usable.

Parameters

No parameters.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.