Referência da API

Database (SQL raw)

Acesso de leitura/escrita de baixo nível ao banco de dados SQLite do PlainApp. Destinado a depuração — uso indevido pode corromper o estado do app.

Definições de Tipo

bash
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.

Operações

query

dbPath

Obtenha o caminho absoluto no sistema de arquivos do banco de dados SQLite do PlainApp.

bash
query GetDbPath {
  dbPath
}
query

dbTables

Liste todos os nomes de tabelas no banco de dados.

bash
query GetDbTables {
  dbTables
}
query

dbTableInfo

Obtenha metadados de coluna para uma tabela.

bash
query GetDbTableInfo($table: String!) {
  dbTableInfo(table: $table) { name type notNull defaultValue primaryKey }
}
query

dbTableRowCount

Conte linhas em uma tabela.

bash
query GetDbTableRowCount($table: String!) {
  dbTableRowCount(table: $table)
}
query

dbTableRows

Leia linhas de uma tabela com paginação. Cada linha é retornada como um objeto JSON mapeando nomes de coluna a valores.

bash
query GetDbTableRows($table: String!, $offset: Int!, $limit: Int!) {
  dbTableRows(table: $table, offset: $offset, limit: $limit)
}
mutation

createDbTableRow

Insira uma linha em uma tabela. O argumento row é uma string JSON.

bash
mutation CreateDbTableRow($table: String!, $row: String!) {
  createDbTableRow(table: $table, row: $row)
}
mutation

deleteDbTableRows

Exclua linhas de uma tabela por id de chave primária.

bash
mutation DeleteDbTableRows($table: String!, $ids: [String!]!) {
  deleteDbTableRows(table: $table, ids: $ids)
}