mirror of
https://github.com/Blah-IM/Weblah.git
synced 2025-05-22 10:01:08 +00:00
feat: [wip] local identity db
This commit is contained in:
parent
2074687692
commit
2827a1bf1f
6 changed files with 30 additions and 0 deletions
6
drizzle.config.ts
Normal file
6
drizzle.config.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { defineConfig } from 'drizzle-kit';
|
||||
export default defineConfig({
|
||||
dialect: 'sqlite',
|
||||
schema: './src/lib/db/schema/*',
|
||||
out: './static/db/drizzle'
|
||||
});
|
|
@ -19,6 +19,7 @@
|
|||
"@tailwindcss/typography": "^0.5.14",
|
||||
"@types/eslint": "^9.6.0",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"drizzle-kit": "^0.24.2",
|
||||
"eslint": "^9.0.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-svelte": "^2.36.0",
|
||||
|
@ -40,6 +41,8 @@
|
|||
"@zeabur/svelte-adapter": "^1.0.0",
|
||||
"bits-ui": "^0.21.13",
|
||||
"canonicalize": "^2.0.0",
|
||||
"drizzle-orm": "^0.33.0",
|
||||
"sqlocal": "^0.11.3",
|
||||
"svelte-boring-avatars": "^1.2.6",
|
||||
"svelte-hero-icons": "^5.2.0",
|
||||
"svelte-persisted-store": "^0.11.0",
|
||||
|
|
5
src/lib/db/common.ts
Normal file
5
src/lib/db/common.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { SQLocalDrizzle } from 'sqlocal/drizzle';
|
||||
import { drizzle } from 'drizzle-orm/sqlite-proxy';
|
||||
|
||||
const { driver, batchDriver } = new SQLocalDrizzle('database.sqlite3');
|
||||
export const db = drizzle(driver, batchDriver);
|
0
src/lib/db/index.ts
Normal file
0
src/lib/db/index.ts
Normal file
6
src/lib/db/schema/config.ts
Normal file
6
src/lib/db/schema/config.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
||||
|
||||
export const configs = sqliteTable('weblah-config', {
|
||||
key: text('key').primaryKey(),
|
||||
value: text('value')
|
||||
});
|
10
src/lib/db/schema/identity.ts
Normal file
10
src/lib/db/schema/identity.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
||||
|
||||
export const identities = sqliteTable('identities', {
|
||||
idKey: text('id_key').primaryKey(),
|
||||
actKeys: text('act_keys').notNull(),
|
||||
profileName: text('profile_name').notNull(),
|
||||
profileBio: text('profile_bio'),
|
||||
preferredChatServerUrls: text('preferred_chat_server_urls').notNull(),
|
||||
idUrls: text('id_urls').notNull()
|
||||
});
|
Loading…
Add table
Reference in a new issue