mdb-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mdb_cli-0.1.0/.gitignore +306 -0
- mdb_cli-0.1.0/LICENSE +21 -0
- mdb_cli-0.1.0/PKG-INFO +220 -0
- mdb_cli-0.1.0/README.md +192 -0
- mdb_cli-0.1.0/mdb/__init__.py +0 -0
- mdb_cli-0.1.0/mdb/atomic.py +25 -0
- mdb_cli-0.1.0/mdb/data/SKILL.md +95 -0
- mdb_cli-0.1.0/mdb/data/__init__.py +0 -0
- mdb_cli-0.1.0/mdb/discovery.py +70 -0
- mdb_cli-0.1.0/mdb/filelock.py +76 -0
- mdb_cli-0.1.0/mdb/formatter.py +101 -0
- mdb_cli-0.1.0/mdb/init.py +150 -0
- mdb_cli-0.1.0/mdb/mdb.py +1214 -0
- mdb_cli-0.1.0/mdb/models.py +81 -0
- mdb_cli-0.1.0/mdb/parser.py +609 -0
- mdb_cli-0.1.0/mdb/puller.py +212 -0
- mdb_cli-0.1.0/mdb/validators.py +46 -0
- mdb_cli-0.1.0/pyproject.toml +58 -0
mdb_cli-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
.worktrees
|
|
2
|
+
|
|
3
|
+
# General
|
|
4
|
+
.DS_Store
|
|
5
|
+
__MACOSX/
|
|
6
|
+
.AppleDouble
|
|
7
|
+
.LSOverride
|
|
8
|
+
Icon[
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
# Thumbnails
|
|
12
|
+
._*
|
|
13
|
+
|
|
14
|
+
# Files that might appear in the root of a volume
|
|
15
|
+
.DocumentRevisions-V100
|
|
16
|
+
.fseventsd
|
|
17
|
+
.Spotlight-V100
|
|
18
|
+
.TemporaryItems
|
|
19
|
+
.Trashes
|
|
20
|
+
.VolumeIcon.icns
|
|
21
|
+
.com.apple.timemachine.donotpresent
|
|
22
|
+
|
|
23
|
+
# Directories potentially created on remote AFP share
|
|
24
|
+
.AppleDB
|
|
25
|
+
.AppleDesktop
|
|
26
|
+
Network Trash Folder
|
|
27
|
+
Temporary Items
|
|
28
|
+
.apdisk
|
|
29
|
+
|
|
30
|
+
*~
|
|
31
|
+
|
|
32
|
+
# temporary files which can be created if a process still has a handle open of a deleted file
|
|
33
|
+
.fuse_hidden*
|
|
34
|
+
|
|
35
|
+
# Metadata left by Dolphin file manager, which comes with KDE Plasma
|
|
36
|
+
.directory
|
|
37
|
+
|
|
38
|
+
# Linux trash folder which might appear on any partition or disk
|
|
39
|
+
.Trash-*
|
|
40
|
+
|
|
41
|
+
# .nfs files are created when an open file is removed but is still being accessed
|
|
42
|
+
.nfs*
|
|
43
|
+
|
|
44
|
+
# Log files created by default by the nohup command
|
|
45
|
+
nohup.out
|
|
46
|
+
|
|
47
|
+
# Windows thumbnail cache files
|
|
48
|
+
Thumbs.db
|
|
49
|
+
Thumbs.db:encryptable
|
|
50
|
+
ehthumbs.db
|
|
51
|
+
ehthumbs_vista.db
|
|
52
|
+
|
|
53
|
+
# Dump file
|
|
54
|
+
*.stackdump
|
|
55
|
+
|
|
56
|
+
# Folder config file
|
|
57
|
+
[Dd]esktop.ini
|
|
58
|
+
|
|
59
|
+
# Recycle Bin used on file shares
|
|
60
|
+
$RECYCLE.BIN/
|
|
61
|
+
|
|
62
|
+
# Windows Installer files
|
|
63
|
+
*.cab
|
|
64
|
+
*.msi
|
|
65
|
+
*.msix
|
|
66
|
+
*.msm
|
|
67
|
+
*.msp
|
|
68
|
+
|
|
69
|
+
# Windows shortcuts
|
|
70
|
+
*.lnk
|
|
71
|
+
|
|
72
|
+
# Byte-compiled / optimized / DLL files
|
|
73
|
+
__pycache__/
|
|
74
|
+
*.py[codz]
|
|
75
|
+
*$py.class
|
|
76
|
+
|
|
77
|
+
# C extensions
|
|
78
|
+
*.so
|
|
79
|
+
|
|
80
|
+
# Distribution / packaging
|
|
81
|
+
.Python
|
|
82
|
+
build/
|
|
83
|
+
develop-eggs/
|
|
84
|
+
dist/
|
|
85
|
+
downloads/
|
|
86
|
+
eggs/
|
|
87
|
+
.eggs/
|
|
88
|
+
lib/
|
|
89
|
+
lib64/
|
|
90
|
+
parts/
|
|
91
|
+
sdist/
|
|
92
|
+
var/
|
|
93
|
+
wheels/
|
|
94
|
+
share/python-wheels/
|
|
95
|
+
*.egg-info/
|
|
96
|
+
.installed.cfg
|
|
97
|
+
*.egg
|
|
98
|
+
MANIFEST
|
|
99
|
+
|
|
100
|
+
# PyInstaller
|
|
101
|
+
# Usually these files are written by a python script from a template
|
|
102
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
103
|
+
*.manifest
|
|
104
|
+
*.spec
|
|
105
|
+
|
|
106
|
+
# Installer logs
|
|
107
|
+
pip-log.txt
|
|
108
|
+
pip-delete-this-directory.txt
|
|
109
|
+
|
|
110
|
+
# Unit test / coverage reports
|
|
111
|
+
htmlcov/
|
|
112
|
+
.tox/
|
|
113
|
+
.nox/
|
|
114
|
+
.coverage
|
|
115
|
+
.coverage.*
|
|
116
|
+
.cache
|
|
117
|
+
nosetests.xml
|
|
118
|
+
coverage.xml
|
|
119
|
+
*.cover
|
|
120
|
+
*.py.cover
|
|
121
|
+
.hypothesis/
|
|
122
|
+
.pytest_cache/
|
|
123
|
+
cover/
|
|
124
|
+
|
|
125
|
+
# Translations
|
|
126
|
+
*.mo
|
|
127
|
+
*.pot
|
|
128
|
+
|
|
129
|
+
# Django stuff:
|
|
130
|
+
*.log
|
|
131
|
+
local_settings.py
|
|
132
|
+
db.sqlite3
|
|
133
|
+
db.sqlite3-journal
|
|
134
|
+
|
|
135
|
+
# Flask stuff:
|
|
136
|
+
instance/
|
|
137
|
+
.webassets-cache
|
|
138
|
+
|
|
139
|
+
# Scrapy stuff:
|
|
140
|
+
.scrapy
|
|
141
|
+
|
|
142
|
+
# Sphinx documentation
|
|
143
|
+
docs/_build/
|
|
144
|
+
|
|
145
|
+
# PyBuilder
|
|
146
|
+
.pybuilder/
|
|
147
|
+
target/
|
|
148
|
+
|
|
149
|
+
# Jupyter Notebook
|
|
150
|
+
.ipynb_checkpoints
|
|
151
|
+
|
|
152
|
+
# IPython
|
|
153
|
+
profile_default/
|
|
154
|
+
ipython_config.py
|
|
155
|
+
|
|
156
|
+
# pyenv
|
|
157
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
158
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
159
|
+
# .python-version
|
|
160
|
+
|
|
161
|
+
# pipenv
|
|
162
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
163
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
164
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
165
|
+
# install all needed dependencies.
|
|
166
|
+
# Pipfile.lock
|
|
167
|
+
|
|
168
|
+
# UV
|
|
169
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
170
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
171
|
+
# commonly ignored for libraries.
|
|
172
|
+
# uv.lock
|
|
173
|
+
|
|
174
|
+
# poetry
|
|
175
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
176
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
177
|
+
# commonly ignored for libraries.
|
|
178
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
179
|
+
# poetry.lock
|
|
180
|
+
# poetry.toml
|
|
181
|
+
|
|
182
|
+
# pdm
|
|
183
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
184
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
185
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
186
|
+
# pdm.lock
|
|
187
|
+
# pdm.toml
|
|
188
|
+
.pdm-python
|
|
189
|
+
.pdm-build/
|
|
190
|
+
|
|
191
|
+
# pixi
|
|
192
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
193
|
+
# pixi.lock
|
|
194
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
195
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
196
|
+
.pixi
|
|
197
|
+
|
|
198
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
199
|
+
__pypackages__/
|
|
200
|
+
|
|
201
|
+
# Celery stuff
|
|
202
|
+
celerybeat-schedule
|
|
203
|
+
celerybeat.pid
|
|
204
|
+
|
|
205
|
+
# Redis
|
|
206
|
+
*.rdb
|
|
207
|
+
*.aof
|
|
208
|
+
*.pid
|
|
209
|
+
|
|
210
|
+
# RabbitMQ
|
|
211
|
+
mnesia/
|
|
212
|
+
rabbitmq/
|
|
213
|
+
rabbitmq-data/
|
|
214
|
+
|
|
215
|
+
# ActiveMQ
|
|
216
|
+
activemq-data/
|
|
217
|
+
|
|
218
|
+
# SageMath parsed files
|
|
219
|
+
*.sage.py
|
|
220
|
+
|
|
221
|
+
# Environments
|
|
222
|
+
.env
|
|
223
|
+
.envrc
|
|
224
|
+
.venv
|
|
225
|
+
env/
|
|
226
|
+
venv/
|
|
227
|
+
ENV/
|
|
228
|
+
env.bak/
|
|
229
|
+
venv.bak/
|
|
230
|
+
|
|
231
|
+
# Spyder project settings
|
|
232
|
+
.spyderproject
|
|
233
|
+
.spyproject
|
|
234
|
+
|
|
235
|
+
# Rope project settings
|
|
236
|
+
.ropeproject
|
|
237
|
+
|
|
238
|
+
# mkdocs documentation
|
|
239
|
+
/site
|
|
240
|
+
|
|
241
|
+
# mypy
|
|
242
|
+
.mypy_cache/
|
|
243
|
+
.dmypy.json
|
|
244
|
+
dmypy.json
|
|
245
|
+
|
|
246
|
+
# Pyre type checker
|
|
247
|
+
.pyre/
|
|
248
|
+
|
|
249
|
+
# pytype static type analyzer
|
|
250
|
+
.pytype/
|
|
251
|
+
|
|
252
|
+
# Cython debug symbols
|
|
253
|
+
cython_debug/
|
|
254
|
+
|
|
255
|
+
# PyCharm
|
|
256
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
257
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
258
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
259
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
260
|
+
# .idea/
|
|
261
|
+
|
|
262
|
+
# Abstra
|
|
263
|
+
# Abstra is an AI-powered process automation framework.
|
|
264
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
265
|
+
# Learn more at https://abstra.io/docs
|
|
266
|
+
.abstra/
|
|
267
|
+
|
|
268
|
+
# Visual Studio Code
|
|
269
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
270
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
271
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
272
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
273
|
+
# .vscode/
|
|
274
|
+
|
|
275
|
+
# Ruff stuff:
|
|
276
|
+
.ruff_cache/
|
|
277
|
+
|
|
278
|
+
# PyPI configuration file
|
|
279
|
+
.pypirc
|
|
280
|
+
|
|
281
|
+
# Marimo
|
|
282
|
+
marimo/_static/
|
|
283
|
+
marimo/_lsp/
|
|
284
|
+
__marimo__/
|
|
285
|
+
|
|
286
|
+
# Streamlit
|
|
287
|
+
.streamlit/secrets.toml
|
|
288
|
+
|
|
289
|
+
.vscode/*
|
|
290
|
+
!.vscode/settings.json
|
|
291
|
+
!.vscode/tasks.json
|
|
292
|
+
!.vscode/launch.json
|
|
293
|
+
!.vscode/extensions.json
|
|
294
|
+
!.vscode/*.code-snippets
|
|
295
|
+
!*.code-workspace
|
|
296
|
+
|
|
297
|
+
# Node.js (interactive-demo)
|
|
298
|
+
node_modules/
|
|
299
|
+
out/
|
|
300
|
+
*.tsbuildinfo
|
|
301
|
+
|
|
302
|
+
# Generated interactive-demo bundle
|
|
303
|
+
docs/assets/interactive-demo.js
|
|
304
|
+
|
|
305
|
+
# mdb databases (tool-managed)
|
|
306
|
+
.mdb/
|
mdb_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mdb-cli contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
mdb_cli-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mdb-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Markdown table workflows w/ SQLite powers ✨
|
|
5
|
+
Project-URL: Homepage, https://atomanoid.github.io/mdb/
|
|
6
|
+
Project-URL: Repository, https://github.com/atomanoid/mdb
|
|
7
|
+
Project-URL: Documentation, https://atomanoid.github.io/mdb/
|
|
8
|
+
Author: atomanoid
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Database
|
|
20
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Provides-Extra: docs
|
|
24
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
|
|
25
|
+
Requires-Dist: mkdocs>=1.6; extra == 'docs'
|
|
26
|
+
Requires-Dist: mkdocstrings[python]>=0.25; extra == 'docs'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<!-- <img src="https://raw.githubusercontent.com/atomanoid/mdb/main/docs/assets/floppy.svg" alt="floppy disk" width="128"> -->
|
|
31
|
+
<img src="https://raw.githubusercontent.com/gist/atomanoid/2e8135956d498969842907b1b149c72f/raw/f9d3aa40f4ebf7b347de617263ac1c7492bd6203/mdb-floppy.svg" alt="floppy disk" width="128">
|
|
32
|
+
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<h1 align="center"><code>mdb-cli</code></h1>
|
|
36
|
+
|
|
37
|
+
<h3 align="center">Markdown table workflows w/ SQLite powers ✨</h3>
|
|
38
|
+
|
|
39
|
+
`mdb-cli` provides the `mdb` command-line tool to make markdown tables data-driven and queryable via SQL, using specialized co-located markers `💾 ...` with some embedded inline SQL queries to **define and dynamically view** our project-level data.
|
|
40
|
+
|
|
41
|
+
- **Zero runtime dependencies** -- standard library only
|
|
42
|
+
- **Simple integration** -- add markers and get running
|
|
43
|
+
- **Python 3.11+** required
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
Install from [PyPI](https://pypi.org/project/mdb-cli/):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Using pipx (recommended)
|
|
51
|
+
pipx install mdb-cli
|
|
52
|
+
|
|
53
|
+
# Using uv (recommended)
|
|
54
|
+
uv tool install mdb-cli
|
|
55
|
+
|
|
56
|
+
# Using pip
|
|
57
|
+
pip install mdb-cli
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
After installation, verify the tool is available:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
mdb --help
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
For development installation, see [CONTRIBUTING.md](https://github.com/atomanoid/mdb/blob/main/CONTRIBUTING.md).
|
|
67
|
+
|
|
68
|
+
## Basic Usage
|
|
69
|
+
|
|
70
|
+
### Marker Syntax
|
|
71
|
+
|
|
72
|
+
Place inline query markers above tables in your markdown file using the following format:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
`💾 [scope] <directive> <sql-query>`
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
| Component | Description |
|
|
79
|
+
| ------------- | ------------------------------------------------------- |
|
|
80
|
+
| `💾` | Marker prefix -- identifies the line as an `mdb` marker |
|
|
81
|
+
| `[scope]` | Optional named scope identifier of the dataset |
|
|
82
|
+
| `<directive>` | Directive: `🌀` (feed) or `💎` (tap) |
|
|
83
|
+
| `<sql-query>` | SQL query to execute against the dataset |
|
|
84
|
+
|
|
85
|
+
## Directives
|
|
86
|
+
|
|
87
|
+
| Directive | Name | Instruction |
|
|
88
|
+
| --------- | ---- | ----------------------------------------------------------------------------------------------------------------- |
|
|
89
|
+
| `🌀` | feed | Include the table below me as part of the dataset |
|
|
90
|
+
| `💎` | tap | Execute my SQL query on the dataset and render the results as the table below me (table auto-generated if absent) |
|
|
91
|
+
|
|
92
|
+
> Under the hood, datasets are ingested into SQLite backing databases on which SQL queries are actually run.
|
|
93
|
+
|
|
94
|
+
### Subcommands
|
|
95
|
+
|
|
96
|
+
| Subcommand | Behavior |
|
|
97
|
+
| ------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| `mdb pull <sql-query>` | process all `🌀` markers first (pulls), then outputs SQL query results in CSV format |
|
|
99
|
+
| `mdb push` | process all `🌀` markers first (pulls), then all `💎` markers after (pushes) |
|
|
100
|
+
| `mdb push <sql-mutation>` | process all `🌀` markers first (pulls), execute the mutation, then all `🌀` and `💎` markers after (pushes) |
|
|
101
|
+
|
|
102
|
+
### Example
|
|
103
|
+
|
|
104
|
+
Given a project file `snacks.md` with the following content:
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
# Snacks
|
|
108
|
+
|
|
109
|
+
## Inventory
|
|
110
|
+
|
|
111
|
+
`💾 🌀 SELECT * FROM snacks`
|
|
112
|
+
|
|
113
|
+
| name | vibe | qty |
|
|
114
|
+
| ------------------ | ------------------ | --- |
|
|
115
|
+
| Hot Cheese Popcorn | chaos energy | 3 |
|
|
116
|
+
| Pocky | elegant simplicity | 12 |
|
|
117
|
+
| Takis | rolled-up danger | 7 |
|
|
118
|
+
| Goldfish | the people's snack | 41 |
|
|
119
|
+
|
|
120
|
+
## Low stock
|
|
121
|
+
|
|
122
|
+
`💾 💎 SELECT name, qty FROM snacks WHERE qty < 10 ORDER BY qty`
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
After running:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
mdb push
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
We'll have the `snacks.md` updated to the following content:
|
|
132
|
+
|
|
133
|
+
```markdown
|
|
134
|
+
# Snacks
|
|
135
|
+
|
|
136
|
+
## Inventory
|
|
137
|
+
|
|
138
|
+
`💾 🌀 SELECT * FROM snacks`
|
|
139
|
+
|
|
140
|
+
| name | vibe | qty |
|
|
141
|
+
| ------------------ | ------------------ | --- |
|
|
142
|
+
| Hot Cheese Popcorn | chaos energy | 3 |
|
|
143
|
+
| Pocky | elegant simplicity | 12 |
|
|
144
|
+
| Takis | rolled-up danger | 7 |
|
|
145
|
+
| Goldfish | the people's snack | 41 |
|
|
146
|
+
|
|
147
|
+
## Low stock
|
|
148
|
+
|
|
149
|
+
`💾 💎 SELECT name, qty FROM snacks WHERE qty < 10 ORDER BY qty`
|
|
150
|
+
|
|
151
|
+
| name | qty |
|
|
152
|
+
| ------------------ | --- |
|
|
153
|
+
| Hot Cheese Popcorn | 3 |
|
|
154
|
+
| Takis | 7 |
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The 🌀 (feed) marker ingests the snacks data into the (unscoped) dataset, then the 💎 (tap) marker executes the query and surfaces only the snacks running low in stock.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
Additionally, after running:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
mdb pull "SELECT SUM(qty) as total_snacks FROM snacks"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
We'll get the output:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
total_snacks
|
|
171
|
+
63
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The 🌀 (feed) marker again ingests the snacks data into the dataset, but the 💎 (tap) marker is not processed.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
We can also mutate data directly. Running:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
mdb push "UPDATE snacks SET qty = qty + 20 WHERE name = 'Takis'"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The 🌀 (feed) marker again ingests the snacks data into the dataset, applies the UPDATE, then both 🌀 (feed) and 💎 (tap) markers push fresh results back:
|
|
185
|
+
|
|
186
|
+
```markdown
|
|
187
|
+
## Inventory
|
|
188
|
+
|
|
189
|
+
`💾 🌀 SELECT * FROM snacks`
|
|
190
|
+
|
|
191
|
+
| name | vibe | qty |
|
|
192
|
+
| ------------------ | ------------------ | --- |
|
|
193
|
+
| Hot Cheese Popcorn | chaos energy | 3 |
|
|
194
|
+
| Pocky | elegant simplicity | 12 |
|
|
195
|
+
| Takis | rolled-up danger | 27 |
|
|
196
|
+
| Goldfish | the people's snack | 41 |
|
|
197
|
+
|
|
198
|
+
## Low stock
|
|
199
|
+
|
|
200
|
+
`💾 💎 SELECT name, qty FROM snacks WHERE qty < 10 ORDER BY qty`
|
|
201
|
+
|
|
202
|
+
| name | qty |
|
|
203
|
+
| ------------------ | --- |
|
|
204
|
+
| Hot Cheese Popcorn | 3 |
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Takis got restocked to 27 and dropped off the low-stock list — all from a single command.
|
|
208
|
+
|
|
209
|
+
## Agent Support
|
|
210
|
+
|
|
211
|
+
`mdb-cli` includes a built-in agent skill. Install it:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
mdb init # default: .mdb/skills/mdb/SKILL.md
|
|
215
|
+
mdb init .claude/skills # Claude Code: .claude/skills/mdb/SKILL.md
|
|
216
|
+
mdb init .opencode/skills # OpenCode: .opencode/skills/mdb/SKILL.md
|
|
217
|
+
mdb init path/to/agent/skills # any agent: path/to/agent/skills/mdb/SKILL.md
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Within a session, invoke the `/mdb` slash command to access a comprehensive reference covering marker syntax, subcommand workflows, templates for common operations, and an error reference guide. The skill provides everything an AI coding assistant needs to construct and debug mdb markers without leaving the editor.
|