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

Make SQL more generic #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ialarmedalien
Copy link

@ialarmedalien ialarmedalien commented Feb 13, 2025

KBase is currently using the semsql schema with a MySQL database and is likely to use it with other SQL db types in the future. This PR alters a couple of lines to use more generic syntax.

Not sure whether I need to propagate these changes to the various other SQL files and the linkml schema.

Turn off whitespace changes - I didn't realise there were so many trailing spaces in the original file!

PRIMARY KEY (id)
);

DROP TABLE statements;
CREATE TABLE statements (stanza TEXT,subject TEXT,predicate TEXT,object TEXT,value TEXT,datatype TEXT,language TEXT);
CREATE TABLE statements (
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting this like the other declarations

@@ -1493,15 +1501,17 @@ CREATE VIEW property_used_with_datatype_values_and_objects AS SELECT
s1.predicate AS subject,
s1.predicate,
s1.datatype AS value
FROM statements AS s1, statements AS s2 ON (s1.predicate=s2.predicate)
FROM statements AS s1
JOIN statements AS s2 ON (s1.predicate=s2.predicate)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySQL doesn't understand , for JOINs so making it explicit

Comment on lines +1603 to +1604
-- patch statements table
ALTER TABLE statements ADD COLUMN graph TEXT;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently gets added in the build.Makefile. Is there a reason for not adding it to the schema?

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

Successfully merging this pull request may close these issues.

1 participant