web3.db-fileconnector
Version:
GraphQL System Built on web3 technologies. Web3.DB is an open database built on top of web3 technologies. It is a decentralized, open-source database that allows users to store and query data in a secure and efficient manner. The system is designed to be
24 lines (20 loc) • 683 B
text/typescript
export async function createModelTable(db: any): Promise<void> {
try {
await db.transaction(async (tx: any) => {
// Removed unused variable 'model_store'
await tx.executeSql(`
CREATE TABLE IF NOT EXISTS model_table (
id TEXT PRIMARY KEY,
model_name TEXT,
created_at INTEGER,
updated_at INTEGER
)
`);
await tx.commit();
});
console.log("Model table created or already exists.");
} catch (error) {
console.error("Error creating model table:", error);
throw error; // Propagate the error
}
}