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

Cheatsheet request: SQLite #675

Open
timogoosenwork opened this issue Jul 26, 2018 · 1 comment
Open

Cheatsheet request: SQLite #675

timogoosenwork opened this issue Jul 26, 2018 · 1 comment

Comments

@timogoosenwork
Copy link

SQLITE.

Some stuff to add:

Enable foreign key support
PRAGMA foreign_keys = ON

Turn on WAL:

PRAGMA journal_mode=WAL;

@chadwithuhc chadwithuhc changed the title Cheatsheet request: APP_NAME_HERE Cheatsheet request: SQLite Nov 16, 2018
@boxxeronfly
Copy link

boxxeronfly commented Jun 11, 2023

A few more that I find helpful

General Examples

SELECT * FROM table WHERE value IS 'correct value'

SELECT column_name As new_name FROM table WHERE value LIKE 'similar value'

Get Tables from database

SELECT name FROM sqlite_master WHERE type='table'

Query JSON embed fields (that are not null, make sure JSON extension is enabled.)

SELECT json_extract(json_column_name, '$.first_key.second_key) FROM myTable WHERE json_extract(json_column_name, '$.first_key.second_key) IS NOT NULL

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

No branches or pull requests

3 participants