-
Notifications
You must be signed in to change notification settings - Fork 10
Add understanding client database page #285
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
base: main
Are you sure you want to change the base?
Conversation
rkistner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall
| <Tab title="Android"> | ||
| Ensure your emulator is running, then replace `com.package-name` with your application's package name, `your-db-name.sqlite` with your database file name, and `~/Desktop/your-db-name.sqlite` with your desired download path. | ||
| ```shell | ||
| adb exec-out run-as com.package-name cat databases/your-db-name.sqlite > ~/Desktop/your-db-name.sqlite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use
adb pullrather than cat. - Also include the WAL file, otherwise recent changes will be lost.
I'd also recommend just using the local dir instead of ~/Desktop, just to simplify the instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am having a difficult time dealing with permissions when using adb pull.
- Why is it better than using
cat? - Are the permission issues likely just something on my side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need the same run-as structure with pull.
If that turns out to tricky, cat could work. The main issues I see with that:
- It probably doesn't work on windows (powershell).
- If you get the > part wrong, it can completely mess up your terminal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see run-as with cat is basically the recommended solution for the permissions issue - I guess we can keep that.
|
|
||
| The `VACUUM` command reclaims unused space in the database: | ||
|
|
||
| ```sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bean1352 in your experience are you comfortable that users will know they need to wrap this in a db.execute() call, or should we point that out?
great PR btw, very overdue!
Added "Understanding The SQLite Database" documentation page with instructions for accessing, inspecting, and optimizing PowerSync database files.
Get the SQLite file
Inspecting the SQLite file
dbstatquery for analyzing table storage usageReducing the SQLite file size