Spaces:
Running
Running
File size: 613 Bytes
1b44660 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import 'dotenv/config';
import { $sources } from './schema';
import { getDb } from './database';
async function main() {
await getDb(process.env.DATABASE_URL!)
.insert($sources)
.values({
id: 1,
name: 'Hacker news',
url: 'https://news.ycombinator.com/rss',
scrape_frequency: 1,
category: 'news',
paywall: false,
lastChecked: new Date(),
})
.onConflictDoNothing();
}
main()
.then(() => {
console.log('✅ Seeded database');
process.exit(0);
})
.catch(err => {
console.error('Error seeding database', err);
process.exit(1);
});
|