Skip to content

Commit

Permalink
feat: query alias for sql function
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed May 31, 2024
1 parent 98b0b0e commit e6a165a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/composables/surreal-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export function useSurrealDB(overrides?: Overrides) {
options?: SurrealAsyncDataOptions<RpcResponse<T>> & { vars: RpcRequest<T, 'query'>['params'][1] },
): Promise<AsyncData<RpcResponse<T> | null, FetchError<any> | null>> {
const { vars, ...opts } = options || {}
console.log(vars)
return useSurrealRPC<T>({ method: 'query', params: [sql, vars] }, opts)
}

Expand All @@ -124,6 +123,8 @@ export function useSurrealDB(overrides?: Overrides) {

return {
items,
$query: $sql,
query: sql,
$sql,
sql,
$version,
Expand Down

0 comments on commit e6a165a

Please sign in to comment.