元編程參考文件

應用資料庫

14 個節點

本頁內容 14

預設檔名

函數

The local database file when nothing names one.

簽名
預設檔名() -> 文字
string DefaultFileName()

返回

結果文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

路徑變數

函數

The variable naming the local database file.

簽名
路徑變數() -> 文字
string PathVariable()

返回

結果文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

網址變數

函數

The variable naming the platform database's address.

簽名
網址變數() -> 文字
string UrlVariable()

返回

結果文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

批量執行

函數

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

簽名
批量執行(語句: Database Statement 陣列) -> Database Result 陣列
DatabaseResult[] Batch(DatabaseStatement[] statements)

參數

名稱型別預設值說明
語句Database Statement 陣列—

返回

結果Database Result 陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

描述

函數

Where this app's database is, in words.

簽名
描述() -> 文字
string Describe()

返回

結果文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

執行

函數

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

簽名
執行(SQL: 文字, 參數: 任意陣列) -> 大整數
long Execute(string sql, object[] parameters)

參數

名稱型別預設值說明
SQL文字—The statement, with ? where each value goes.
參數任意陣列—The values for the placeholders, in order.

返回

受影響行數大整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

按名稱參數執行

函數

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

簽名
按名稱參數執行(SQL: 文字, 值: 文字到文字的字典) -> 大整數
long ExecuteNamed(string sql, Dictionary<string, string> values)

參數

名稱型別預設值說明
SQL文字—
值文字到文字的字典—

返回

受影響行數大整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

插入

函數

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

簽名
插入(SQL: 文字, 參數: 任意陣列) -> 大整數
long Insert(string sql, object[] parameters)

參數

名稱型別預設值說明
SQL文字—
參數任意陣列—

返回

行 ID大整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

按名稱參數插入

函數

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

簽名
按名稱參數插入(SQL: 文字, 值: 文字到文字的字典) -> 大整數
long InsertNamed(string sql, Dictionary<string, string> values)

參數

名稱型別預設值說明
SQL文字—
值文字到文字的字典—

返回

行 ID大整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

查詢

函數

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

簽名
查詢(SQL: 文字, 參數: 任意陣列) -> Database Result
DatabaseResult Query(string sql, object[] parameters)

參數

名稱型別預設值說明
SQL文字—The statement, with ? where each value goes.
參數任意陣列—The values for the placeholders, in order.

返回

結果Database Result
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

按名稱參數查詢

函數

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.

簽名
按名稱參數查詢 -> Database Result
    SQL: 文字
    值: 文字到文字的字典
DatabaseResult QueryNamed(
    string sql,
    Dictionary<string, string> values)

參數

名稱型別預設值說明
SQL文字—The statement, with :name (or @name, $name) where each value goes.
值文字到文字的字典—The values by name.

返回

結果Database Result
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

語句

函數

A statement for AppDatabase.Batch.

簽名
語句(SQL: 文字, 參數: 任意陣列) -> Database Statement
DatabaseStatement Statement(string sql, object[] parameters)

參數

名稱型別預設值說明
SQL文字—
參數任意陣列—

返回

語句Database Statement
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

使用資料庫

函數

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

簽名
使用資料庫(提供者: I App Database Provider)
void Use(IAppDatabaseProvider provider)

參數

名稱型別預設值說明
提供者I App Database Provider—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用

設定值

函數

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.

簽名
設定值 -> 文字到文字的字典
    值: 文字到文字的字典
    名稱: 文字
    值: 文字
Dictionary<string, string> WithValue(
    Dictionary<string, string> values,
    string name,
    string value)

參數

名稱型別預設值說明
值文字到文字的字典—The values so far - a handler's Parameters.
名稱文字—The name the statement uses for it, without the colon.
值文字—Its value.

返回

值文字到文字的字典

備註

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.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
應用資料庫
所屬包
網路應用