mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
update app create config to accept libsql config directly
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { APIContext } from "astro";
|
||||
import { App } from "bknd";
|
||||
import { registerLocalMediaAdapter, serve } from "bknd/adapter/astro";
|
||||
import { serve } from "bknd/adapter/astro";
|
||||
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
||||
import { boolean, em, entity, text } from "bknd/data";
|
||||
import { secureRandomString } from "bknd/utils";
|
||||
|
||||
@@ -26,10 +27,7 @@ declare module "bknd/core" {
|
||||
export const ALL = serve<APIContext>({
|
||||
// we can use any libsql config, and if omitted, uses in-memory
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "file:test.db"
|
||||
}
|
||||
url: "file:test.db"
|
||||
},
|
||||
// an initial config is only applied if the database is empty
|
||||
initialConfig: {
|
||||
|
||||
@@ -7,10 +7,7 @@ import { type BunBkndConfig, serve } from "bknd/adapter/bun";
|
||||
// this is optional, if omitted, it uses an in-memory database
|
||||
const config: BunBkndConfig = {
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: ":memory:"
|
||||
}
|
||||
url: ":memory:"
|
||||
},
|
||||
// this is only required to run inside the same workspace
|
||||
// leave blank if you're running this from a different project
|
||||
|
||||
@@ -29,10 +29,7 @@ declare module "bknd/core" {
|
||||
export default serve({
|
||||
// we can use any libsql config, and if omitted, uses in-memory
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://localhost:8080"
|
||||
}
|
||||
url: "http://localhost:8080"
|
||||
},
|
||||
// an initial config is only applied if the database is empty
|
||||
initialConfig: {
|
||||
|
||||
@@ -7,10 +7,7 @@ import { serve } from "bknd/adapter/node";
|
||||
/** @type {import("bknd/adapter/node").NodeBkndConfig} */
|
||||
const config = {
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: ":memory:"
|
||||
}
|
||||
url: ":memory:"
|
||||
},
|
||||
// this is only required to run inside the same workspace
|
||||
// leave blank if you're running this from a different project
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { App } from "bknd";
|
||||
import { registerLocalMediaAdapter, serve } from "bknd/adapter/remix";
|
||||
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
||||
import { serve } from "bknd/adapter/remix";
|
||||
import { boolean, em, entity, text } from "bknd/data";
|
||||
import { secureRandomString } from "bknd/utils";
|
||||
|
||||
@@ -22,10 +23,7 @@ declare module "bknd/core" {
|
||||
const handler = serve({
|
||||
// we can use any libsql config, and if omitted, uses in-memory
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "file:test.db"
|
||||
}
|
||||
url: "file:test.db"
|
||||
},
|
||||
// an initial config is only applied if the database is empty
|
||||
initialConfig: {
|
||||
|
||||
@@ -8,10 +8,7 @@ import { App } from "bknd";
|
||||
async function getBknd() {
|
||||
const bknd = App.create({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://localhost:8080"
|
||||
}
|
||||
url: "http://localhost:8080"
|
||||
}
|
||||
});
|
||||
await bknd.build();
|
||||
|
||||
Reference in New Issue
Block a user