Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kearfy/surrealdb-lq-where-filter-broken-for-deletions
Showcase of LQ filters being broken when it comes to deletions
https://github.com/kearfy/surrealdb-lq-where-filter-broken-for-deletions
Last synced: about 1 month ago
JSON representation
Showcase of LQ filters being broken when it comes to deletions
- Host: GitHub
- URL: https://github.com/kearfy/surrealdb-lq-where-filter-broken-for-deletions
- Owner: kearfy
- Created: 2023-08-14T12:52:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-14T12:52:49.000Z (over 1 year ago)
- Last Synced: 2024-10-14T20:34:21.052Z (2 months ago)
- Language: TypeScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demonstration of broken LQ behaviour
## Prepare
- Make sure Deno is installed
- Make sure SurrealDB is installed## To run
- First, start SurrealDB (if you haven't already)
- `deno task dev:surreal`
- Or otherwise have a DB instance running with the options configured in the `main.ts` file.
- Second, run the script
- Once: `deno task dev`
- Watch mode: `deno task dev:watch` (will rerun everytime you save the `main.ts` file)## Issue this script demonstrates
This demo demonstrates two issues:
- We have a live query named "LIVE". This LQ has a `WHERE` clause which filters only people that are verified.
- It fails to send any deletions to the client, which could be explained by maybe the filter being applied to the deleted record (where the data does not exist anymore)
- We have a live query named "NONE". This LQ has a `WHERE` clause which filters only people where `verified` is `NONE`.
- This sends through only all the deletions, which demonstrates that the filters for deletions are applied to the deleted record (where the data does not exist anymore)
- We have a live query named "ALTQ". This LQ does not have any filters and will send over every message coming through.