Last active
January 25, 2025 15:14
-
-
Save mtsd/4265641 to your computer and use it in GitHub Desktop.
SQLite snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| CREATE文における各種データ型の設定 | |
| 擬似的にBOOLEAN型を設定 | |
| */ | |
| CREATE TABLE IF NOT EXISTS tests (id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| memo TEXT, | |
| image BLOB, | |
| type INTEGER, | |
| favorite BOOLEAN NOT NULL DEFAULT 0 CONSTRAINT testsFavorite CHECK (favorite IN (0, 1) OR favorite IS NULL), | |
| createdAt DATETIME | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| 日付表示 | |
| */ | |
| sqlite> select primaryKey, datetime(createdAt, 'unixepoch', 'localtime') from h_r_c_addresses; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment