Divooka Reference

SQLite Files

4 nodes

On this page 4

Query SQLite

Function

Runs a query in SQLite's own SQL on a database file and gives back the rows it answers with as a table. The file is only read: nothing a query says changes it.

Signature
QuerySQLite(path: Text, SQL: Text) -> Table
Table QuerySQLite(string path, string sql)

Parameters

nametypedefaultdescription
pathText—The database file.
SQLText—The query - a SELECT, a WITH or a PRAGMA that reports - in SQLite's SQL, naming the database's tables.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
SQLite Files
Package
Data Analytics

Read SQLite

Function

A table or view of a SQLite database, every row of it: the first one made when none is named. Each column keeps its kind - numbers as numbers, text as text, truths as truths and dates as dates.

Signature
ReadSQLite(path: Text, table: Text) -> Table
Table ReadSQLite(string path, string table = "")

Parameters

nametypedefaultdescription
pathText—The database file.
tableText—The table or view to read; the first when empty.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
SQLite Files
Package
Data Analytics

SQLite Table Names

Function

The names of a SQLite database's tables and views, in the order they were made.

Signature
SQLiteTableNames(path: Text) -> Text Array
string[] SQLiteTableNames(string path)

Parameters

nametypedefaultdescription
pathText—The database file.

Returns

NamesText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
SQLite Files
Package
Data Analytics

Write SQLite

Function

Writes tables into a SQLite database file, a database table each, and gives back the file's path. The file is made if there is none, and a table of the same name already in it is replaced, unless Append says to add the rows to it; the database's other tables are left as they were. Tables are named by Table Names, else by each table's own name, else Table1, Table2 and so on. Every table goes in or none does.

Signature
WriteSQLite -> Text
    tables: Table Array
    path: Text
    tableNames: Text Array
    append: Truth
string WriteSQLite(
    Table[] tables,
    string path,
    string[] tableNames,
    bool append = false)

Parameters

nametypedefaultdescription
tablesTable Array—The tables, a database table each.
pathText—The database file; it and its folder are made if need be.
tableNamesText Array—What to call each table in the database, in the same order; optional.
appendTruthFalseAdd the rows to a table of the same name already in the file, rather than replacing it.

Returns

PathText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
SQLite Files
Package
Data Analytics