Files
comicverse/src/lib/sqlite.ts

38 lines
552 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;
2024-09-25 16:01:30 -03:00
pages: Page[];
2024-09-23 20:52:40 -03:00
};
2024-09-25 16:01:30 -03:00
type Page = {
title: string;
src: string;
background: string;
iteraction: Iteraction[];
};
type Iteraction = {
x: number;
y: number;
link: string;
};
export type { Project, Iteraction, Page };
2024-09-23 20:52:40 -03:00
export default db;