Files
comicverse/src/lib/sqlite.ts

29 lines
429 B
TypeScript
Raw Normal View History

2024-09-23 20:52:40 -03:00
import sqlite3 from 'sqlite3';
import { open } from 'sqlite';
const db = await open({
filename: 'data.db',
driver: sqlite3.cached.Database
});
await db.exec(`
CREATE TABLE IF NOT EXISTS projects (
ID text NOT NULL,
Name text NOT NULL,
PRIMARY KEY(ID)
)
`);
type Project = {
id: string;
title: string;
pages: {
title: string;
src: string;
background: string;
}[];
};
export type { Project };
export default db;