Inside italic/bold code segments every bare word is a variable — including call arguments and method-call receivers — so text literals must be quoted and receivers no longer need backticks. A bare dotted callee `a.b` resolves as a method call when `a` is a local variable, otherwise as a library path (Python-style unified namespace), in both the tree-walk and bytecode backends. Migrate ~70 tests plus ext/web, ext/quantum, ext/ai and the example projects to the new idiom; update SKILL.md and the design docs; fix the web/quantum example data model (db/index.mq.md). Unit and gold suites pass; only the 3 network-live tests fail offline. Co-authored-by: Cursor <cursoragent@cursor.com>
1.1 KiB
1.1 KiB
title: web db.select where smoke description: Offline select with map and filter-table where (no listen). import web:ext/web/web.mq.md import articles:web-fixtures/db/articles.mq.md import json:lib/json.mq.md
main
store = > web.db url="sqlite:web-fixtures/data/select-smoke.db" schema = > articles.schema
store.init name=articles fields=schemastore.exec sql="DELETE FROM articles"
rows =
| title | body |
|---|---|
| Alpha | first |
| Beta | second |
| Alpha again | third |
store.insert table=articles rows=rows
eq =
| title | body |
|---|---|
| Alpha | first |
hit = > store.select table="articles" where=eq limit=50
n = > len value=hit
n== 1
print text=map-where-ok
print text=map-where-fail
filt =
| 字段 | 操作 | 值 |
|---|---|---|
| title | like | %Alpha% |
like_rows = > store.select table="articles" where=filt limit=50
ln = > len value=like_rows
ln== 2
print text=like-ok
print text=like-fail
all = > store.select table="articles" limit=50
an = > len value=all
an== 3
print text=all-ok
print text=all-fail