`import json:lib/json.mq.md` binds file libraries; `import fmt:time.format` binds member short names (replaces `> use`). Legacy `> path.mq.md` / `> use` now hard-error with a hint. Migrates repo docs, skills, ext, lib, public, examples, man-test and tests; adds a negative gold and updates view/catalog rendering. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
465 B
Markdown
21 lines
465 B
Markdown
---
|
|
title: db/index
|
|
description: Open sqlite, init articles, seed once.
|
|
import web:ext/web/web.mq.md
|
|
import articles:articles.mq.md
|
|
import fs:lib/fs.mq.md
|
|
---
|
|
|
|
## open
|
|
|
|
*`store` = > web.db url="sqlite:data/site.db" *
|
|
*`fields` = > articles.schema *
|
|
> `store`.init name=articles fields=`fields`
|
|
*`rows` = > `store`.select table=articles limit=1 *
|
|
1. `rows`
|
|
**`store`**
|
|
2. *
|
|
*`seed` = > articles.seed *
|
|
> `store`.insert table=articles rows=`seed`
|
|
**`store`**
|