minor refactors to the adapter code

This commit is contained in:
2026-02-09 00:55:48 +05:30
parent 624b4d35e0
commit 4927be7206
7 changed files with 193 additions and 75 deletions

View File

@@ -1,10 +1,39 @@
import type { NextjsBkndConfig } from "bknd/adapter/nextjs";
import { type BkndConfig, em, entity, text, boolean } from "bknd";
// Unrelated to framework adapters
import { registerLocalMediaAdapter } from "bknd/adapter/node";
const local = registerLocalMediaAdapter();
// --------------------- SCHEMA -----------------------
// this just for testing
const schema = em({
todos: entity("todos", {
title: text(),
done: boolean(),
}),
post:entity("posts",{
title: text(),
content: text(),
})
});
// --------------------- SCHEMA END -----------------------
export default {
connection: {
url: "data.db",
},
options:{
}
} satisfies NextjsBkndConfig;
options: {},
config: {
data: schema.toJSON(),
auth: { enabled: true },
media: {
enabled: true,
adapter: local({
path: "./public/uploads",
}),
},
},
} satisfies BkndConfig;