Compile Cypher to SQLite's SQL, reads and writes
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
调研方向
Start with the shared SQL compiler, the SQLite store from #80, and the shared spec for queries, writes, temporal behavior, and refusals. Then review the SQLite cross-engine contracts, noting which tests need a second writer and cannot run under SQLite's write lock. Done means the Cypher compiler, registered SQLite functions, serialized write steps, and stated test contracts work together.
由索引模型根据 Issue 内容生成。
描述
Port of liberation-data/drivine4j203: the Cypher compiler's SQLite target, so a Cypher statement runs on a SQLite graph and gives the rows a graph engine gives. It builds on the SQLite store (#80).
What drivine4j does
- A third dialect of the shared SQL compiler, beside Postgres and Oracle. A compiled statement opens with
/* drivine:json */, so its text values are read as JSON. - Values are JSON text. A value that passes through a subquery is text again, so it is wrapped in
json(…)wherever it goes intojson_array,json_object,json_group_arrayorjson_set. - Functions registered on each connection do what SQLite's JSON functions don't:
drivine_equal(a, b): Cypher equality.1equals1.0, maps compare in any key order, null gives null.drivine_contains(props, map): a pattern's map of properties.drivine_add(a, b):+of numbers, lists (a null is taken as an item) and texts.drivine_canonical(json): maps' keys in order, soDISTINCTand grouping treat two maps of the same entries as one.drivine_upper,drivine_split,drivine_reverse,drivine_uuid.drivine_regex_group,drivine_regexp_replace(groups written\1).drivine_trunc: whole where it fits. A real within 2 ulps of a whole number counts as that number.drivine_to_char: theto_charpatterns the temporal SQL uses.drivine_temporal(op, …):local,utc,extract,add_months,add_time,months_between,seconds_between,truncate.
- Timestamps are fixed-width ISO text,
YYYY-MM-DDTHH:MM:SS.ffffff. The statement's clock is a literal taken as it is compiled, so one statement reads one clock. - No LATERAL. An
OPTIONAL MATCH, aCALL { … }, a walk or a shortest path gathers its rows as a JSON list of maps in a subquery:json_each((SELECT json_group_array(json_object(…)) FROM (…) q)). That subquery can read the outer row. Each column is read back with->(JSON,NULLIF(…, 'null')) or->>. - Id lists are
,1,2,text, as on Oracle. - An order puts nulls
NULLS LASTascending andNULLS FIRSTdescending. It sorts byx ->> '$'. - Writes are a procedure of steps: select-into, let, loop over a query's rows, if, raise, execute (
RETURNING … INTO), return. The steps are serialised as JSON. Each variable a step's SQL reads becomes a numbered parameter (?1); literals and quoted names are skipped.drivine_cypher(steps, params)carries the steps out on the statement's connection under a SAVEPOINT. =~istext REGEXP ('^(?:' || pattern || ')\z').
Tests
- Run the shared spec on SQLite: queries, writes, temporal, refusals.
- Run the cross-engine contracts that seed in Cypher.
- Contract tests that need a second writer inside an open transaction can't run on SQLite: a transaction holds the write lock from
BEGIN IMMEDIATE.
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 1 小时 16 分钟
- 30 天内合并 PR
- 74
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
liberation-data/drivine-python 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
liberation-data/drivine-python#154 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
liberation-data/drivine-python#152 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
liberation-data/drivine-python#150 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
liberation-data/drivine-python#138 ·
维护者通常 1 天内回复
-
Cypher on SQL stores: all(), any(), none() and single() are two-valued where the predicate is null未关闭
难度 4/5 3-5 天 新手友好度 55/100
liberation-data/drivine-python#159 ·
维护者通常 1 天内回复
查看 liberation-data/drivine-python 的全部 Issue
相似的 Issue
-
request-theme
难度 1/5 1 小时以内 新手友好度 66/100
LizardByte/ThemerrDB#9575 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 62/100
acl-org/acl-anthology#10599 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
zilliztech/memsearch#818 ·
维护者通常 1 天内回复
-
[FAQ] Commit ID for Projects可能已有人在做 @github-actions 今天认领。 未关闭faq-proposal
难度 1/5 1 小时以内 新手友好度 84/100
DataTalksClub/faq#503 · 1 条评论 ·
维护者通常 2 天内回复
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-free可能已有人在做 @Aaqibhafeezkhan 今天认领。 未关闭beginner documentation good first issue
难度 2/5 1-3 小时 新手友好度 75/100
BistaDinesh03/critique#164 · 1 条评论 ·
维护者通常 1 天内回复