diff --git a/docs/src/index.md b/docs/src/index.md index 695ac1e..d9a9d16 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -139,3 +139,44 @@ - Subset of React components to typecheck against - Aggregated queries and group by? Joins? + + - Middleware interface / higher-order nodes + + - the idea would be it would be solely dependent on / modify another + - i think this would also want to pair with some notion of app-private nodes + + - for example, use cases would be: + + - version control? + + - update "hook" for this would create a third node and append it + + ``` + const newPrev = new Node() + newPrev.prev = curr.prev + curr.prev = newPrev + ``` + + creates like a linked list of version updates + + - Pub/Sub? + + - i think this could use the same interface as the query interface, so you + would just "listen" to updates there, rather than just getting a single + snapshot of it + + - findNodes interface: + - Params + - mode, one of "single", "many", "stream" + - single: return a single document + - many: return many documents (may limit with take) + - TODO: what does a cursor look like? + - stream: open a socket and keep listening for + - streamType, one of "inserts" or "updates" + - metadata: object + - `{ [keyName] : { has?: boolean, value?: [value], select: boolean } }` + - has means if it's not in there, then filter it out + - value means that if the value's not exactly a match, then filter + it out + - could this include valueMatches, which runs a custom predicate? + - select means should this be included in the result diff --git a/src/core/db.ts b/src/core/db.ts index 9755e8e..be0c116 100644 --- a/src/core/db.ts +++ b/src/core/db.ts @@ -97,6 +97,8 @@ export class Database { } } + // TODO: Notify pubsub streams that this has been created? + return createdNode; }); } @@ -125,6 +127,8 @@ export class Database { } }); + // TODO: Notify pubsub streams that this has updated? + return await this.prisma.node.findFirst({ where: { id: request.id }, select: { id: true, label: true, metadata: true }, diff --git a/src/routes/calendar/index.tsx b/src/routes/calendar/index.tsx new file mode 100644 index 0000000..3443961 --- /dev/null +++ b/src/routes/calendar/index.tsx @@ -0,0 +1,3 @@ +export default function Calendar() { + return <>Calendar; +}