forked from bluesky/tiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Minor bug fixes and enhancements #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c267003
BUG: point landing page GraphQL link at /api/graphql
genematx ab636ff
MNT: remove unused graph.core module
genematx 86cb6b1
BUG: create and drop namespaces table in graph migration
genematx 36e9f30
ENH: provision graph tables through the catalog schema
genematx d84d556
ENH: preload a graph-specific query in the GraphiQL editor
genematx c25ad44
STY: tidy imports in graph table provisioning
genematx a4f8e0c
DOC: minor fixes
genematx 99cf6f0
MNT: rename graph.tables module to graph.orm
genematx 20e1d48
ENH: limit GraphQL query depth on the graph endpoint
genematx 5913197
PERF: create graph links via foreign-key constraint instead of pre-ch…
genematx 2744f8e
DOC: remove stale JSON-LD import/export references
genematx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| """ | ||
| SQLAlchemy Core table definitions for the graph (splash-links) feature. | ||
|
|
||
| These tables live in the catalog database alongside the catalog's own tables | ||
| (``entities.node_id`` is a foreign key into the catalog ``nodes`` table). They | ||
| are attached to the catalog's ``Base.metadata`` so that the two supported ways | ||
| of provisioning a catalog database both include them: | ||
|
|
||
| * a fresh database created by ``tiled.catalog.core.initialize_database`` | ||
| (which runs ``Base.metadata.create_all``), and | ||
| * an existing database upgraded through the Alembic migration | ||
| ``c31f6a1d7e20``. | ||
|
|
||
| The store (``tiled.graph.store``) uses these ``Table`` objects to read and | ||
| write rows; it does not create them itself. This mirrors how ``metadata_fts5`` | ||
| is declared as a Core table on ``Base.metadata`` in ``tiled.catalog.orm``. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from sqlalchemy import JSON, Column, DateTime, ForeignKey, Index, Integer, String, Table | ||
|
|
||
| from ..catalog.base import Base | ||
|
|
||
| metadata = Base.metadata | ||
|
|
||
| entities = Table( | ||
| "entities", | ||
| metadata, | ||
| Column("id", String, primary_key=True), | ||
| Column( | ||
| "node_id", | ||
| Integer, | ||
| ForeignKey("nodes.id", ondelete="SET NULL"), | ||
| nullable=True, | ||
| ), | ||
| Column("entity_type", String, nullable=False), | ||
| Column("name", String, nullable=False), | ||
| Column("uri", String, nullable=True), | ||
| Column("properties", JSON, nullable=False), | ||
| Column("access_blob", JSON, nullable=False), | ||
| Column("created_at", DateTime(timezone=True), nullable=False), | ||
| Index("entities_node_id_idx", "node_id"), | ||
| Index("entities_type_created_idx", "entity_type", "created_at"), | ||
| Index("entities_uri_idx", "uri"), | ||
| ) | ||
|
|
||
| links = Table( | ||
| "links", | ||
| metadata, | ||
| Column("id", String, primary_key=True), | ||
| Column( | ||
| "subject_id", | ||
| String, | ||
| ForeignKey("entities.id", ondelete="CASCADE"), | ||
| nullable=False, | ||
| ), | ||
| Column("predicate", String, nullable=False), | ||
| Column( | ||
| "object_id", | ||
| String, | ||
| ForeignKey("entities.id", ondelete="CASCADE"), | ||
| nullable=False, | ||
| ), | ||
| Column("properties", JSON, nullable=False), | ||
| Column("access_blob", JSON, nullable=False), | ||
| Column("created_at", DateTime(timezone=True), nullable=False), | ||
| Index("links_subject_predicate_idx", "subject_id", "predicate"), | ||
| Index("links_predicate_object_idx", "predicate", "object_id"), | ||
| Index("links_triple_idx", "subject_id", "predicate", "object_id"), | ||
| ) | ||
|
|
||
| namespaces = Table( | ||
| "namespaces", | ||
| metadata, | ||
| Column("prefix", String, primary_key=True), | ||
| Column("uri", String, nullable=False), | ||
| Column("created_at", DateTime(timezone=True), nullable=False), | ||
| ) |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought...since we're marking this new feature as experimental, do we even want to link to it from the tiled landing page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave it out for now -- easy to add later. @danielballan, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'm good either wya.