-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move queries into separate module for clarity
Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
2 changed files
with
26 additions
and
20 deletions.
There are no files selected for viewing
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,22 @@ | ||
create_subsystem_sql = """ | ||
CREATE TABLE subsystems ( | ||
name TEXT PRIMARY KEY NOT NULL | ||
);""" | ||
|
||
create_nodes_sql = """CREATE TABLE nodes ( | ||
subsystem TEXT NOT NULL, | ||
label TEXT NOT NULL, | ||
type TEXT NOT NULL, | ||
basename TEXT NOT NULL, | ||
name TEXT NOT NULL, | ||
id INTEGER NOT NULL, | ||
FOREIGN KEY(subsystem) REFERENCES subsystems(name), | ||
UNIQUE (subsystem, label) | ||
);""" | ||
|
||
create_attributes_sql = """CREATE TABLE attributes ( | ||
name TEXT NOT NULL, | ||
value TEXT NOT NULL, | ||
node TEXT NOT NULL, | ||
FOREIGN KEY(node) REFERENCES nodes(label) | ||
);""" |
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