Is it possible to dump only part of a database? I have a database containing 250'000 entries. I want to create a second one with a tenth of the data in it...
using
select * from table where id % 10 = 0
and setting
.output out.sql
yields a file that does not have the binary data encoded in the same way as when using
.dump
dump -> the binary data gets encoded as hex bytes
other way -> it gets encoded as some weird string
Instead of dumping to a file, you can directly write a new database:
ATTACH DATABASE New.db AS new;
CREATE TABLE new.stuff AS (SELECT * FROM table WHERE id % 10 = 0);
This should create the table stuff in New.db.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With