diff --git a/.docs/diagram/caching-db-struct.d2 b/.docs/diagram/caching-db-struct.d2 index d977bce..10454da 100644 --- a/.docs/diagram/caching-db-struct.d2 +++ b/.docs/diagram/caching-db-struct.d2 @@ -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} @@ -24,16 +26,16 @@ 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 @@ -41,6 +43,91 @@ data: { 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 diff --git a/.docs/diagram/caching-db-struct.svg b/.docs/diagram/caching-db-struct.svg index 4b8e3ea..52047dd 100644 --- a/.docs/diagram/caching-db-struct.svg +++ b/.docs/diagram/caching-db-struct.svg @@ -1,10 +1,10 @@ -entitiesidINTPK_idTEXTUNQ_entityTEXTUNQ_metaTEXT_bodyTEXTNameTEXTRepoUrlTEXTOriginTEXTVersionTEXTIsLatestVersionBOOLEANIsPseudoVersionBOOLEANAbsPathTEXTHaveBOOLEANHashTEXTExistBOOLEANSchemaTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIMEmetaidINTPKentities_idINTFKdata_idINTFKinsert_date_timeDATETIMEupdate_date_timeDATETIMEdataidINTPKentities_idINTFK_idTEXTproperty_nameTEXTproperty_valueTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIME - + .d2-966445777 .fill-N1{fill:#0A0F25;} + .d2-966445777 .fill-N2{fill:#676C7E;} + .d2-966445777 .fill-N3{fill:#9499AB;} + .d2-966445777 .fill-N4{fill:#CFD2DD;} + .d2-966445777 .fill-N5{fill:#DEE1EB;} + .d2-966445777 .fill-N6{fill:#EEF1F8;} + .d2-966445777 .fill-N7{fill:#FFFFFF;} + .d2-966445777 .fill-B1{fill:#0D32B2;} + .d2-966445777 .fill-B2{fill:#0D32B2;} + .d2-966445777 .fill-B3{fill:#E3E9FD;} + .d2-966445777 .fill-B4{fill:#E3E9FD;} + .d2-966445777 .fill-B5{fill:#EDF0FD;} + .d2-966445777 .fill-B6{fill:#F7F8FE;} + .d2-966445777 .fill-AA2{fill:#4A6FF3;} + .d2-966445777 .fill-AA4{fill:#EDF0FD;} + .d2-966445777 .fill-AA5{fill:#F7F8FE;} + .d2-966445777 .fill-AB4{fill:#EDF0FD;} + .d2-966445777 .fill-AB5{fill:#F7F8FE;} + .d2-966445777 .stroke-N1{stroke:#0A0F25;} + .d2-966445777 .stroke-N2{stroke:#676C7E;} + .d2-966445777 .stroke-N3{stroke:#9499AB;} + .d2-966445777 .stroke-N4{stroke:#CFD2DD;} + .d2-966445777 .stroke-N5{stroke:#DEE1EB;} + .d2-966445777 .stroke-N6{stroke:#EEF1F8;} + .d2-966445777 .stroke-N7{stroke:#FFFFFF;} + .d2-966445777 .stroke-B1{stroke:#0D32B2;} + .d2-966445777 .stroke-B2{stroke:#0D32B2;} + .d2-966445777 .stroke-B3{stroke:#E3E9FD;} + .d2-966445777 .stroke-B4{stroke:#E3E9FD;} + .d2-966445777 .stroke-B5{stroke:#EDF0FD;} + .d2-966445777 .stroke-B6{stroke:#F7F8FE;} + .d2-966445777 .stroke-AA2{stroke:#4A6FF3;} + .d2-966445777 .stroke-AA4{stroke:#EDF0FD;} + .d2-966445777 .stroke-AA5{stroke:#F7F8FE;} + .d2-966445777 .stroke-AB4{stroke:#EDF0FD;} + .d2-966445777 .stroke-AB5{stroke:#F7F8FE;} + .d2-966445777 .background-color-N1{background-color:#0A0F25;} + .d2-966445777 .background-color-N2{background-color:#676C7E;} + .d2-966445777 .background-color-N3{background-color:#9499AB;} + .d2-966445777 .background-color-N4{background-color:#CFD2DD;} + .d2-966445777 .background-color-N5{background-color:#DEE1EB;} + .d2-966445777 .background-color-N6{background-color:#EEF1F8;} + .d2-966445777 .background-color-N7{background-color:#FFFFFF;} + .d2-966445777 .background-color-B1{background-color:#0D32B2;} + .d2-966445777 .background-color-B2{background-color:#0D32B2;} + .d2-966445777 .background-color-B3{background-color:#E3E9FD;} + .d2-966445777 .background-color-B4{background-color:#E3E9FD;} + .d2-966445777 .background-color-B5{background-color:#EDF0FD;} + .d2-966445777 .background-color-B6{background-color:#F7F8FE;} + .d2-966445777 .background-color-AA2{background-color:#4A6FF3;} + .d2-966445777 .background-color-AA4{background-color:#EDF0FD;} + .d2-966445777 .background-color-AA5{background-color:#F7F8FE;} + .d2-966445777 .background-color-AB4{background-color:#EDF0FD;} + .d2-966445777 .background-color-AB5{background-color:#F7F8FE;} + .d2-966445777 .color-N1{color:#0A0F25;} + .d2-966445777 .color-N2{color:#676C7E;} + .d2-966445777 .color-N3{color:#9499AB;} + .d2-966445777 .color-N4{color:#CFD2DD;} + .d2-966445777 .color-N5{color:#DEE1EB;} + .d2-966445777 .color-N6{color:#EEF1F8;} + .d2-966445777 .color-N7{color:#FFFFFF;} + .d2-966445777 .color-B1{color:#0D32B2;} + .d2-966445777 .color-B2{color:#0D32B2;} + .d2-966445777 .color-B3{color:#E3E9FD;} + .d2-966445777 .color-B4{color:#E3E9FD;} + .d2-966445777 .color-B5{color:#EDF0FD;} + .d2-966445777 .color-B6{color:#F7F8FE;} + .d2-966445777 .color-AA2{color:#4A6FF3;} + .d2-966445777 .color-AA4{color:#EDF0FD;} + .d2-966445777 .color-AA5{color:#F7F8FE;} + .d2-966445777 .color-AB4{color:#EDF0FD;} + .d2-966445777 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>entitiesidINTPK_idTEXTUNQ_entityTEXTUNQ_metaTEXT_bodyTEXTNameTEXTRepoUrlTEXTOriginTEXTVersionTEXTIsLatestVersionBOOLEANIsPseudoVersionBOOLEANAbsPathTEXTHaveBOOLEANHashTEXTExistBOOLEANSchemaTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIMEmetaidINTPKentities_idINTFKbody_idINTFKinsert_date_timeDATETIMEupdate_date_timeDATETIMEbodyidINTPKentities_idINTFKschema_property_idINTFK_idTEXTproperty_nameTEXTproperty_valueTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIMEentity_inclusionparent_body_idINTFKchild_body_idINTFKinsert_date_timeDATETIMEupdate_date_timeDATETIMEschemaidINTPKentities_idINTFK$idTEXTtitleTEXTdescriptionTEXTtypeTEXTrequiredTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIMEschema_propertiesidINTPKschema_idINTFKschema_property_idINTFKdescriptionTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIMEschema_propertyidINTPKroot_schema_idINTFKnameTEXTtypeENUM [string, number, integer, boolean, array, object, null]formatTEXTpatternTEXTdefaultTEXTenumTEXTconstTEXTminLengthINTmaxLengthINTminimumINTmaximumINTmultipleOfFLOATitems_idINTFKdescriptionTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIMEschema_item_propertiesidINTPKschema_item_idINTFKschema_property_idINTFKdescriptionTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIMEschema_itemidINTPKtypeENUM [string, number, integer, boolean, array, object, null]descriptionTEXTinsert_date_timeDATETIMEupdate_date_timeDATETIME + diff --git a/.docs/query.md b/.docs/query.md index 7da611f..ae3f3eb 100644 --- a/.docs/query.md +++ b/.docs/query.md @@ -179,11 +179,7 @@ JSON: "directory": "/var/www/", "listen": [ { - "_id": "90397be7-fe81-4159-90cf-e7ddd1857fed", - "_entity": "github.com/AmadlaOrg/EntitySystem/Net@v1.0.0", - "_body": { "ports": [80, 443] - } } ] }