diff --git a/docs/src/index.md b/docs/src/index.md index c6bbb4b..71aed20 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -40,12 +40,18 @@ - Hooks: - Hooks consist of a (pattern, type, callback). The pattern is a metadata - matcher, that determines if the node should be executed upon. The - callback is Javascript code executed in the app's execution context. + matcher, that determines if the node should be executed upon. The + callback is Javascript code executed in the app's execution context. - Type determines what kind of callback to call. - - Ensures callbacks: these make sure that a node has - - + + - Ensures callbacks: these make sure that a node has + + - Need to somehow figure out how to represent partially executed + processes? i.e if a video indexer needs to take time to go through the + video, the nodes should be available and committed, but somehow + indicate that one of its processes isn't done + - Maybe this should be a flag on the `NodeMeta` table - Database service: @@ -84,9 +90,9 @@ - Interfaces: - - + - - - Content / blob storage + - Content / blob storage - Interfaces: @@ -125,7 +131,7 @@ - Migrations? - If an application needs to migrate its data format, should we formalize - this? + this? - Data migrations that don't need to create / delete nodes, only metadata - Have the frontend also shipped with the backend? diff --git a/flake.lock b/flake.lock index 658bf97..2569a96 100644 --- a/flake.lock +++ b/flake.lock @@ -192,16 +192,16 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1677501028, - "narHash": "sha256-VAVrXSz75rPdBOz9Jg75rpA3VBvw4WO+hFvk+A4f6Mc=", + "lastModified": 1679932808, + "narHash": "sha256-bSyAWJ4ukiXVyKI1iGvCs2cMgW1jdYRs5cgTdOCXvrQ=", "owner": "prisma", "repo": "prisma-engines", - "rev": "8fde8fef4033376662cad983758335009d522acb", + "rev": "659ef412370fa3b41cd7bf6e94587c1dfb7f67e7", "type": "github" }, "original": { "owner": "prisma", - "ref": "4.11.0", + "ref": "4.12.0", "repo": "prisma-engines", "type": "github" } diff --git a/flake.nix b/flake.nix index 86d1c0d..a1c0acc 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; fenix.url = "github:nix-community/fenix"; - prisma-engines.url = "github:prisma/prisma-engines?ref=4.11.0"; + prisma-engines.url = "github:prisma/prisma-engines?ref=4.12.0"; }; outputs = { self, nixpkgs, flake-utils, fenix, prisma-engines }: diff --git a/package-lock.json b/package-lock.json index 2b3cbba..cc35faf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@types/express": "^4.17.17", "json-schema-static-docs": "^0.23.0", "nativescript": "^8.5.1", - "prisma": "^4.11.0", + "prisma": "^4.12.0", "ts-node": "^10.9.1", "typescript": "^5.0.2", "vite": "^4.2.1", @@ -1932,10 +1932,11 @@ } }, "node_modules/@prisma/engines": { - "version": "4.11.0", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.12.0.tgz", + "integrity": "sha512-0alKtnxhNB5hYU+ymESBlGI4b9XrGGSdv7Ud+8TE/fBNOEhIud0XQsAR+TrvUZgS4na5czubiMsODw0TUrgkIA==", "devOptional": true, - "hasInstallScript": true, - "license": "Apache-2.0" + "hasInstallScript": true }, "node_modules/@prisma/engines-version": { "version": "4.11.0-57.8fde8fef4033376662cad983758335009d522acb", @@ -9590,12 +9591,13 @@ } }, "node_modules/prisma": { - "version": "4.11.0", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-4.12.0.tgz", + "integrity": "sha512-xqVper4mbwl32BWzLpdznHAYvYDWQQWK2tBfXjdUD397XaveRyAP7SkBZ6kFlIg8kKayF4hvuaVtYwXd9BodAg==", "devOptional": true, "hasInstallScript": true, - "license": "Apache-2.0", "dependencies": { - "@prisma/engines": "4.11.0" + "@prisma/engines": "4.12.0" }, "bin": { "prisma": "build/index.js", diff --git a/package.json b/package.json index 1cd348c..2040d74 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@types/express": "^4.17.17", "json-schema-static-docs": "^0.23.0", "nativescript": "^8.5.1", - "prisma": "^4.11.0", + "prisma": "^4.12.0", "ts-node": "^10.9.1", "typescript": "^5.0.2", "vite": "^4.2.1", diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1ec06ef..24fa0b8 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -25,9 +25,15 @@ model Interface { } model Edge { - id String @id @default(uuid()) + id String @id @default(uuid()) label String? + /// The app that created this edge + app App @relation(fields: [appId], references: [id]) + appId String + + appKey String + fromId String fromNode Node @relation(name: "fromNode", fields: [fromId], references: [id]) @@ -35,19 +41,23 @@ model Edge { toNode Node @relation(name: "toNode", fields: [toId], references: [id]) @@unique([fromId, toId]) + @@index([appId, appKey]) } model NodeMeta { nodeId String - node Node @relation(fields: [nodeId], references: [id]) + node Node @relation(fields: [nodeId], references: [id]) - appId String + /// The app that created this metadata field app App @relation(fields: [appId], references: [id]) + appId String + + appKey String - key String value Bytes - @@id([nodeId, appId, key]) + @@id([nodeId, appId, appKey]) + @@index([appId, appKey]) } model NodeImplements { @@ -70,6 +80,7 @@ model App { patterns Patterns[] metaKeys NodeMeta[] + edges Edge[] } /// Regular expressions table @@ -77,7 +88,7 @@ model Patterns { id String @id @default(uuid()) pattern String - + /// Pattern type, see docs for details type String