-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Database design adds a new binding device table (#113)
- Loading branch information
1 parent
2f3f71c
commit 7ff3112
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
composeApp/src/commonMain/sqldelight/com/clipevery/data/Device.sq
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CREATE TABLE deviceInfo ( | ||
device_id TEXT NOT NULL, | ||
user_name TEXT NOT NULL, | ||
device_state TEXT NOT NULL, | ||
app_version TEXT NOT NULL, | ||
host_name TEXT NOT NULL, | ||
host_address TEXT NOT NULL, | ||
platform_name TEXT NOT NULL, | ||
platform_version TEXT NOT NULL, | ||
platform_arch TEXT NOT NULL, | ||
platform_bit_mode INTEGER NOT NULL, | ||
PRIMARY KEY (device_id, user_name) | ||
); | ||
|
||
|
||
CREATE INDEX deviceInfo_device_state_index ON deviceInfo (device_state); | ||
|
||
|
||
selectAll: | ||
SELECT * | ||
FROM deviceInfo; | ||
|
||
insert: | ||
INSERT INTO deviceInfo(device_id, user_name, device_state, app_version, host_name, host_address, platform_name, platform_version, platform_arch, platform_bit_mode) | ||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?); |