File tree Expand file tree Collapse file tree 22 files changed +220
-22
lines changed
01.solution.simple/src/db
02.problem.template/src/db
02.solution.template/src/db
04.problem.completion/src/db
04.solution.completion/src/db
05.solution.linked/src/db
06.problem.embedded/src/db
06.solution.embedded/src/db
01.problem.prompts/src/db
01.solution.prompts/src/db
02.problem.optimized-prompt/src/db
02.solution.optimized-prompt/src/db
03.problem.completion/src/db
03.solution.completion/src/db
01.solution.simple/src/db
02.problem.advanced/src/db
02.solution.advanced/src/db Expand file tree Collapse file tree 22 files changed +220
-22
lines changed Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import path from 'node:path'
23import { DB } from './index.js'
34
45async function seed ( ) {
5- const db = DB . getInstance ( path . join ( process . cwd ( ) , 'db.sqlite' ) )
6+ const dbPath = path . join ( process . cwd ( ) , 'db.sqlite' )
7+ const dbExists = await fs . stat ( dbPath ) . then (
8+ ( ) => true ,
9+ ( ) => false ,
10+ )
11+ // delete the db file if it exists
12+ if ( dbExists ) await fs . unlink ( dbPath )
13+
14+ const db = DB . getInstance ( dbPath )
615
716 // Helper to run raw SQL (DB class does not expose this, so we use createTag etc. for clearing)
817 // We'll clear by deleting all entries via getEntries/getTags and deleteEntry/deleteTag
You can’t perform that action at this time.
0 commit comments