Browse the docs
Input node

SQLite Files

Read a table, or the result of a SQL query, from a local SQLite database file.

Category
Input

What it does

Reads from a SQLite database file: either a whole table, or the result of a SQL query you write against the file. SQLite is a complete database in one file, so this is how you get data out of a .db someone handed you. Because SQLite stores a type per CELL rather than per column, Trinium reads a sample of rows first to decide what each column is.

Inputs and outputs

InputsNone. This node starts a pipeline.
OutputsOne.

When to use it

  • Pull one table out of a .db or .sqlite file
  • Filter or join inside the file so less data enters the pipeline
  • Read an extract produced by a phone app, a desktop tool, or an earlier run

Examples

Whole table

Table: customers

Reads every row and column. The common case.

Filtered query

SELECT * FROM orders WHERE total > 100

A query wins whenever both a table and a query are filled in.

Join inside the file

SELECT o.*, c.name FROM orders o JOIN customers c ON c.id = o.cust_id

Cheaper than reading both tables and joining them on the canvas.

A column that changes late

Inference rows: 0

Reads every row before deciding types. Slower, but nothing can surprise it.

Tips

  • Press ⤢ beside SQL query for the SQL Studio: a full-screen editor that shows the columns your query returns and runs it with Run to here without closing.
  • The query is SQLite's own SQL dialect. This is a source query, not a Trinium row expression, so SQLite functions are what's available here.
  • Leave the query blank to read the table as it is.
  • SQLite stores a type per cell rather than per column, so column types are decided from the first 10,000 rows. If a column turns out to hold something else further down, the run stops and names it: raise Inference rows, or set it to 0 to check every row.
  • Exactly ONE database file per node. Unlike the CSV and Parquet readers there is no stacking here; use two nodes and a Union if you have two files.
  • Its columns show in the builder without a run, for a hand-written query as well as a picked table.
  • When the file you upload is an archive (.zip or .tar) of several databases, turn on 'Run each file separately' to process each one as its own run, named by its path inside the archive (exports.zip!eu/sales.db). Every start does this, a schedule and a flow step included. The runs take turns, one at a time.