Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SQLite instead of Postgres? #641

Open
dentarg opened this issue Jun 14, 2024 · 4 comments
Open

Use SQLite instead of Postgres? #641

dentarg opened this issue Jun 14, 2024 · 4 comments
Labels

Comments

@dentarg
Copy link
Member

dentarg commented Jun 14, 2024

There is a lot of chatter about how great SQLite is.

@dentarg
Copy link
Member Author

dentarg commented Jun 14, 2024

@dentarg
Copy link
Member Author

dentarg commented Jun 14, 2024

I ran into jeremyevans/sequel#2176

@dentarg
Copy link
Member Author

dentarg commented Jun 15, 2024

Data can be migrated using sequel

$ sequel --copy-databases postgres://localhost/wikimum sqlite://storage/wiki.db
Databases connections successful
Migrations dumped successfully
Tables created
Begin copying data
Begin copying records for table: schema_info
Finished copying 1 records for table: schema_info
Begin copying records for table: users
Finished copying 1 records for table: users
Begin copying records for table: revisions
Finished copying 0 records for table: revisions
Begin copying records for table: pages
Finished copying 2 records for table: pages
Finished copying data
Begin creating indexes
Finished creating indexes
Begin adding foreign key constraints
Finished adding foreign key constraints
Database copy finished in 0.067332 seconds

@dentarg
Copy link
Member Author

dentarg commented Jun 15, 2024

No problem with production

$ sequel --copy-databases postgres://localhost/prod-wikimum sqlite://storage/prod-wiki.db
Databases connections successful
Migrations dumped successfully
Tables created
Begin copying data
Begin copying records for table: schema_info
Finished copying 1 records for table: schema_info
Begin copying records for table: users
Finished copying 145 records for table: users
Begin copying records for table: pages
Finished copying 452 records for table: pages
Begin copying records for table: revisions
Finished copying 4186 records for table: revisions
Finished copying data
Begin creating indexes
Finished creating indexes
Begin adding foreign key constraints
Finished adding foreign key constraints
Database copy finished in 0.422092 seconds

Some stats

$ ls -ahl starkast_wiki_backup_2024-06-15_215012.sql
-rw-r--r--@ 1 dentarg  staff    24M Jun 15 21:51 starkast_wiki_backup_2024-06-15_215012.sql

$ ls -ahl storage/prod-wiki.db
-rw-r--r--  1 dentarg  staff    49M Jun 15 21:53 storage/prod-wiki.db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant