import Surreal from "https://deno.land/x/surrealdb@v0.5.0/mod.ts";
/**
* @param query The query string.
* @param variables The variables used in the query.
*/
type Surrealdb = {
url: string;
token: string;
};
export async function main(
auth: Surrealdb,
namespace: string,
database: string,
query: string,
variables?: Record<string, unknown>,
) {
const client = new Surreal(auth.url, auth.token);
await client.use(namespace, database);
const result = await client.query(query, variables);
client.close();
return result;
}
Submitted by hugo697 3 days ago
import Surreal from "https://deno.land/x/surrealdb@v0.5.0/mod.ts";
/**
* @param query The query string.
* @param variables The variables used in the query.
*/
type Surrealdb = {
url: string;
token: string;
};
export async function main(
auth: Surrealdb,
namespace: string,
database: string,
query: string,
variables?: Record<string, unknown>,
) {
const client = new Surreal(auth.url, auth.token);
await client.use(namespace, database);
const result = await client.query(query, variables);
client.close();
return result;
}
Submitted by admin 635 days ago
import Surreal from 'https://deno.land/x/surrealdb@v0.5.0/mod.ts'
/**
* @param query The query string.
* @param variables The variables used in the query.
*/
type Surrealdb = {
url: string;
token: string;
};
export async function main(
auth: Surrealdb,
namespace: string,
database: string,
query: string,
variables?: Record<string, unknown>
) {
const client = new Surreal(auth.url, auth.token)
await client.use(namespace, database)
const result = await client.query(query, variables)
client.close()
return result
}
Submitted by admin 639 days ago
import type { Resource } from 'https://deno.land/x/windmill@v1.86.0/mod.ts'
import Surreal from 'https://deno.land/x/surrealdb@v0.5.0/mod.ts'
/**
* @param query The query string.
* @param variables The variables used in the query.
*/
export async function main(
auth: Resource<'surrealdb'>,
namespace: string,
database: string,
query: string,
variables?: Record<string, unknown>
) {
const client = new Surreal(auth.url, auth.token)
await client.use(namespace, database)
const result = await client.query(query, variables)
client.close()
return result
}
Submitted by adam186 761 days ago
import type { Resource } from 'https://deno.land/x/windmill@v1.86.0/mod.ts'
import Surreal from 'https://deno.land/x/surrealdb@v0.5.0/mod.ts'
/**
* @param query The query string.
* @param variables The variables used in the query.
*/
async function main(
auth: Resource<'surrealdb'>,
namespace: string,
database: string,
query: string,
variables?: Record<string, unknown>
) {
const client = new Surreal(auth.url, auth.token)
await client.use(namespace, database)
const result = await client.query(query, variables)
client.close()
return result
}
Submitted by adam186 761 days ago