Batteries
SQL
Accent
Scheme
Backdrop motion
Batteries

SQL

SQLite itself, in the page: a real table you can query.

A database

sql.open gives the database of a name. It lives in the site's private files and is written there after every statement that changes it.
Open, version, closeThe table is made and filled with 38 bodies of the solar system the first time. Reload: it is still here.
…SQLite
–rows in bodies
openingstate
The name is the playground's own: "mote-playground". Closing lets another window open it.
The database as a filesql.bytes is the whole database as a .sqlite file: any SQLite tool opens it.
Read it to see its size and how every SQLite file begins.

Queries

sql.run gives the rows as records by column name. Several statements separated by ; run in turn, and the last one's rows are given.
Run any SQLType a query, or take one of these. It is the real engine: joins, grouping, window functions, json_extract, create and drop.
00000000000000000000000000000000000000000000000000
Open the database to run a query.
ParametersEach ? takes the next value of the list: values never become part of the SQL text. A resource runs it again when a control moves.
kind = ?
radius_km >= ?500 km
the call
sql.run(d, "… where kind = ? and radius_km >= ? …", ["moon", 500])
0 found
A batch: all or nonesql.batch runs its statements as one. The second batch's last insert breaks the unique name, so its first insert is taken back too.
–rows before
–rows after
–changed by
Run either batch and compare the counts.

Other databases

sql.load opens a .sqlite file's bytes as a database in memory: nothing it does is kept, and the named one is not touched.
Load a file, in memoryTake a copy of the database above, or pick any .sqlite file from your machine. Then close it.
No file is loaded.
esc
Pages
StartStart
Buttons & badgesComponents
Cards & disclosureComponents
Dialogs & drawersComponents
Menus & commandsComponents
Dates & tablesComponents
ChartsComponents
Chart galleryComponents
FieldsComponents
ChoicesComponents
DisplayComponents
NavigationComponents
Popovers & sheetsComponents
MessagesChat & AI
Prompt inputChat & AI
Reasoning & toolsChat & AI
Developer partsChat & AI
ConversationChat & AI
Code artifactsChat & AI
VoiceChat & AI
Code blocksChat & AI
MarkdownChat & AI
EditorElements
TerminalElements
FlowElements
3D boxesElements
PaintElements
SurfaceElements
MediaElements
IconsElements
PrimitivesElements
SQLBatteries
StorageBatteries
Net & resourcesBatteries
Crypto & bytesBatteries
ZipBatteries
TablesBatteries
PDFBatteries
TimeBatteries
ImagesBatteries
ScanBatteries
Video & audioBatteries
SearchBatteries
SyntaxBatteries
PatternsBatteries
NotifyBatteries
ShareBatteries
State & logicLanguage
WorkersLanguage
Events & elementsLanguage
StylingLanguage
RoutesLanguage
ShortcutsLanguage
Long listsLanguage
Failures & tryLanguage
Back endBack end
Models & writesBack end
Rules & failuresBack end
Jobs & schedulesBack end
Running itBack end
ExtensionsBack end
AIBack end
AnalyticsBack end
AboutAbout
↑↓move
↵open
676 places · ranked by BM25