neondb
Version:
create a claimable Neon database in seconds!
13 lines (10 loc) • 355 B
JavaScript
import { neon } from '@neondatabase/serverless';
import { getSqlCommands } from './utils/fs.js';
async function seedDatabase(schemaFilePath, connectionString) {
const client = neon(connectionString);
const commands = getSqlCommands(schemaFilePath);
for (const command of commands) {
await client.query(command);
}
}
export { seedDatabase };