2023-08-06 18:36:24 +00:00
|
|
|
import Knex from 'knex'
|
|
|
|
|
|
|
|
export const db = Knex({
|
|
|
|
client: 'sqlite3', // or 'better-sqlite3'
|
|
|
|
connection: {
|
|
|
|
filename: "data/database"
|
2023-08-09 12:07:34 +00:00
|
|
|
},
|
|
|
|
useNullAsDefault: true
|
2023-08-06 18:36:24 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
export const getWords = async (db) => {
|
|
|
|
return db
|
|
|
|
.select("word")
|
|
|
|
.from("dictionary")
|
|
|
|
}
|
|
|
|
|