Divooka Reference

App Database

14 nodes

On this page 14

Default File Name

Function

The local database file when nothing names one.

Signature
DefaultFileName() -> Text
string DefaultFileName()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Path Variable

Function

The variable naming the local database file.

Signature
PathVariable() -> Text
string PathVariable()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Url Variable

Function

The variable naming the platform database's address.

Signature
UrlVariable() -> Text
string UrlVariable()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Batch

Function

Runs several statements as one: either all of them take effect, or - when any is refused - none does.

Signature
Batch(statements: Database Statement Array) -> Database Result Array
DatabaseResult[] Batch(DatabaseStatement[] statements)

Parameters

nametypedefaultdescription
statementsDatabase Statement Array—

Returns

ResultsDatabase Result Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Describe

Function

Where this app's database is, in words.

Signature
Describe() -> Text
string Describe()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Execute

Function

Runs a statement that changes something - CREATE, INSERT, UPDATE, DELETE - and says how many rows it changed.

Signature
Execute(SQL: Text, parameters: Any Array) -> Large Integer
long Execute(string sql, object[] parameters)

Parameters

nametypedefaultdescription
SQLText—The statement, with ? where each value goes.
parametersAny Array—The values for the placeholders, in order.

Returns

Rows AffectedLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Execute Named

Function

Runs a statement that changes something, with its values named as AppDatabase.QueryNamed names them, and says how many rows it changed.

Signature
ExecuteNamed -> Large Integer
    SQL: Text
    values: Dictionary of Text to Text
long ExecuteNamed(string sql, Dictionary<string, string> values)

Parameters

nametypedefaultdescription
SQLText—
valuesDictionary of Text to Text—

Returns

Rows AffectedLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Insert

Function

Runs a statement that inserts one row and gives back the new row's id.

Signature
Insert(SQL: Text, parameters: Any Array) -> Large Integer
long Insert(string sql, object[] parameters)

Parameters

nametypedefaultdescription
SQLText—
parametersAny Array—

Returns

Row IdLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Insert Named

Function

Runs a statement that inserts one row, with its values named as AppDatabase.QueryNamed names them, and gives back the new row's id.

Signature
InsertNamed -> Large Integer
    SQL: Text
    values: Dictionary of Text to Text
long InsertNamed(string sql, Dictionary<string, string> values)

Parameters

nametypedefaultdescription
SQLText—
valuesDictionary of Text to Text—

Returns

Row IdLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Query

Function

Runs a statement that reads - a SELECT - and gives back its rows.

Signature
Query(SQL: Text, parameters: Any Array) -> Database Result
DatabaseResult Query(string sql, object[] parameters)

Parameters

nametypedefaultdescription
SQLText—The statement, with ? where each value goes.
parametersAny Array—The values for the placeholders, in order.

Returns

ResultDatabase Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Query Named

Function

Runs a statement that reads, with its values named: :name in the SQL takes the value of name in Values - a web request's parameters, as an endpoint's handler receives them.

Signature
QueryNamed -> Database Result
    SQL: Text
    values: Dictionary of Text to Text
DatabaseResult QueryNamed(
    string sql,
    Dictionary<string, string> values)

Parameters

nametypedefaultdescription
SQLText—The statement, with :name (or @name, $name) where each value goes.
valuesDictionary of Text to Text—The values by name.

Returns

ResultDatabase Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Statement

Function

A statement for AppDatabase.Batch.

Signature
Statement -> Database Statement
    SQL: Text
    parameters: Any Array
DatabaseStatement Statement(string sql, object[] parameters)

Parameters

nametypedefaultdescription
SQLText—
parametersAny Array—

Returns

StatementDatabase Statement
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

Use

Function

Uses Provider from now on, closing the one in use. For a host that decides where the database is itself, and for tests.

Signature
Use(provider: I App Database Provider)
void Use(IAppDatabaseProvider provider)

Parameters

nametypedefaultdescription
providerI App Database Provider—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications

With Value

Function

The values with one more - or one replaced - for a named statement: a request's parameters plus what the handler worked out, a password's hash or a time, without changing the request's own.

Signature
WithValue -> Dictionary of Text to Text
    values: Dictionary of Text to Text
    name: Text
    value: Text
Dictionary<string, string> WithValue(
    Dictionary<string, string> values,
    string name,
    string value)

Parameters

nametypedefaultdescription
valuesDictionary of Text to Text—The values so far - a handler's Parameters.
nameText—The name the statement uses for it, without the colon.
valueText—Its value.

Returns

ValuesDictionary of Text to Text

Remarks

A handler is a Function graph, which cannot add to a dictionary in place; this answers a new one, so a value the handler computed reaches :name as the request's fields do, rather than being spliced into the SQL text.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
App Database
Package
Web Applications