Skip to content

Commit

Permalink
Continued to work on the Query language EQL and the db schema struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbdz committed Nov 28, 2024
1 parent f9a2c26 commit ef00f3d
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 87 deletions.
97 changes: 92 additions & 5 deletions .docs/diagram/caching-db-struct.d2
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# TODO: Need to add other schema details like data type, constrains, etc. From the information here we need to be able to regenerate the schema and the .hery file. Maybe add another table for other details from the schema

entities: {
shape: sql_table
id: INT {constraint: primary_key}
Expand All @@ -24,23 +26,108 @@ meta: {
shape: sql_table
id: INT {constraint: primary_key}
entities_id: INT {constraint: foreign_key}
data_id: INT {constraint: foreign_key}
body_id: INT {constraint: foreign_key}
insert_date_time: DATETIME
update_date_time: DATETIME
}

# TODO: Need to add other schema details like data type, constrains, etc. From the information here we need to be able to regenerate the schema and the .hery file. Maybe add another table for other details from the schema
data: {
body: {
shape: sql_table
id: INT {constraint: primary_key}
entities_id: INT {constraint: foreign_key}
schema_property_id: INT {constraint: foreign_key}
_id: TEXT
property_name: TEXT
property_value: TEXT
insert_date_time: DATETIME
update_date_time: DATETIME
}

entity_inclusion: {
shape: sql_table
parent_body_id: INT {constraint: foreign_key}
child_body_id: INT {constraint: foreign_key}
insert_date_time: DATETIME
update_date_time: DATETIME
}

schema: {
shape: sql_table
id: INT {constraint: primary_key}
entities_id: INT {constraint: foreign_key}
\$id: TEXT
title: TEXT
description: TEXT
type: TEXT
required: TEXT
insert_date_time: DATETIME
update_date_time: DATETIME
}

schema_properties: {
shape: sql_table
id: INT {constraint: primary_key}
schema_id: INT {constraint: foreign_key}
schema_property_id: INT {constraint: foreign_key}
description: TEXT
insert_date_time: DATETIME
update_date_time: DATETIME
}

schema_property: {
shape: sql_table
id: INT {constraint: primary_key}
root_schema_id: INT {constraint: foreign_key}
name: TEXT
type: ENUM \[string, number, integer, boolean, array, object, null\]
format: TEXT
pattern: TEXT
default: TEXT
enum: TEXT
const: TEXT
minLength: INT
maxLength: INT
minimum: INT
maximum: INT
multipleOf: FLOAT
items_id: INT {constraint: foreign_key}
description: TEXT
insert_date_time: DATETIME
update_date_time: DATETIME
}

schema_item_properties: {
shape: sql_table
id: INT {constraint: primary_key}
schema_item_id: INT {constraint: foreign_key}
schema_property_id: INT {constraint: foreign_key}
description: TEXT
insert_date_time: DATETIME
update_date_time: DATETIME
}

schema_item: {
shape: sql_table
id: INT {constraint: primary_key}
type: ENUM \[string, number, integer, boolean, array, object, null\]
description: TEXT
insert_date_time: DATETIME
update_date_time: DATETIME
}

entities.id -> meta.entities_id
meta.data_id -> data.id
entities.id -> data.entities_id
meta.body_id -> body.id
entities.id -> body.entities_id
entities.id -> schema.entities_id

schema.id -> schema_properties.schema_id
schema_properties.schema_property_id -> schema_property.id
schema_item_properties.schema_item_id -> schema_item.id
schema_item_properties.schema_property_id -> schema_property.id

entity_inclusion.parent_body_id -> body.id
entity_inclusion.child_body_id -> body.id

body.schema_property_id -> schema_property.id

schema_property.root_schema_id -> schema.id
Loading

0 comments on commit ef00f3d

Please sign in to comment.