usar db.db

This commit is contained in:
Cat /dev/Nulo 2024-08-13 20:13:02 -03:00
parent 905d94a55e
commit 5943d80252
7 changed files with 8 additions and 6 deletions

View file

@ -2,6 +2,8 @@ data/warcs/
data/carrefour/ data/carrefour/
*/*.db* */*.db*
sqlite.db sqlite.db
db.db
db.db-wal
downloader/ downloader/
node_modules/ node_modules/
*/node_modules/ */node_modules/

View file

@ -1 +1 @@
DB_PATH=../sqlite.db DB_PATH=../db.db

View file

@ -1,4 +1,4 @@
export const DB_PATH = process.env.DB_PATH ?? "../sqlite.db"; export const DB_PATH = process.env.DB_PATH ?? "../db.db";
/** @type { import("drizzle-kit").Config } */ /** @type { import("drizzle-kit").Config } */
export default { export default {

View file

@ -1 +1 @@
DATABASE_URL=sqlite://../sqlite.db DATABASE_URL=sqlite://../db.db

View file

@ -282,7 +282,7 @@ async fn main() {
.connect_with( .connect_with(
SqliteConnectOptions::from_str(&format!( SqliteConnectOptions::from_str(&format!(
"sqlite://{}", "sqlite://{}",
env::var("DB_PATH").unwrap_or("../sqlite.db".to_string()) env::var("DB_PATH").unwrap_or("../db.db".to_string())
)) ))
.unwrap() .unwrap()
.journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal)

View file

@ -17,7 +17,7 @@ pub struct Db {
impl Db { impl Db {
pub async fn connect() -> anyhow::Result<Self> { pub async fn connect() -> anyhow::Result<Self> {
let db_path = env::var("DB_PATH").unwrap_or("../sqlite.db".to_string()); let db_path = env::var("DB_PATH").unwrap_or("../db.db".to_string());
info!("Opening DB at {}", db_path); info!("Opening DB at {}", db_path);
let read_pool = connect_to_db(&db_path, 32).await?; let read_pool = connect_to_db(&db_path, 32).await?;
let write_pool = connect_to_db(&db_path, 1).await?; let write_pool = connect_to_db(&db_path, 1).await?;

View file

@ -1,2 +1,2 @@
DB_PATH=../sqlite.db DB_PATH=../db.db
VITE_API_HOST=http://localhost:8000 VITE_API_HOST=http://localhost:8000