Otter Snippets Otter Upstream Otter 1.0.1 Tested

SQLite Table Query (Parameterized)

Execute parameterized SQLite queries and iterate over record rows safely.

ID: snippet/db-sqlite-query Version: 1.0.0 License: MIT Framework: Otter 1.0.1

Architecture & Runtime Preview

Otter 1.0.1

Zero-dependency Otter 1.0.1 snippet (Data & Records). Copy the parameterized template or run the self-contained example.

  1. 1Category: Data & Records
  2. 2Attribution: Otter Core Language Spec (D97, D98, RFC Sec 9)
  3. 3Zero external pack dependencies — paste directly into any .ot file

Source Code (2 files)

template.ot · otter
database has
    provider is "sqlite"
    connection is "${dbPath}"
.
connect database into ${db}
execute ${db} with
    "${sqlCreateTable}"

execute ${db} with
    "${sqlInsert}"
    parameter "${paramName}" is ${paramValue}
into ${insertResult}

query ${db} with
    "${sqlSelect}"
into ${rows}
for each ${row} in ${rows}
    say ${row}
.

Installation & Usage

otter snippet inspect db-sqlite-query

Copy template.ot directly into your .ot source file, or run example.ot with 'otter run example.ot'.