Database (SQL raw)
Accesso in lettura/scrittura low-level al database SQLite di PlainApp. Destinato al debug — un uso improprio può corrompere lo stato dell'app.
Definizioni di tipo
type DbTableInfo {
# Column metadata for a single table.
# Platform-dependent; see PlainApp source for the full list of fields.
}
# dbTableRows returns an array of JSON objects (one per row).
# Each object maps column name to value.
# dbTables and dbTableRowCount return plain scalars.Operazioni
dbPath
Recupera il percorso filesystem assoluto del database SQLite di PlainApp.
query GetDbPath {
dbPath
}dbTables
Elenca tutti i nomi delle tabelle nel database.
query GetDbTables {
dbTables
}dbTableInfo
Recupera i metadati delle colonne per una tabella.
query GetDbTableInfo($table: String!) {
dbTableInfo(table: $table) { name type notNull defaultValue primaryKey }
}dbTableRowCount
Conta le righe in una tabella.
query GetDbTableRowCount($table: String!) {
dbTableRowCount(table: $table)
}dbTableRows
Legge righe da una tabella con paginazione. Ogni riga è restituita come oggetto JSON che mappa nomi colonna a valori.
query GetDbTableRows($table: String!, $offset: Int!, $limit: Int!) {
dbTableRows(table: $table, offset: $offset, limit: $limit)
}createDbTableRow
Inserisce una riga in una tabella. L'argomento row è una stringa JSON.
mutation CreateDbTableRow($table: String!, $row: String!) {
createDbTableRow(table: $table, row: $row)
}deleteDbTableRows
Elimina righe da una tabella per id chiave primaria.
mutation DeleteDbTableRows($table: String!, $ids: [String!]!) {
deleteDbTableRows(table: $table, ids: $ids)
}