Modules@robinpath/database

@robinpath/database

0.1.0Public

SQLite database operations for RobinPath automation workflows

@robinpath/database

SQLite database with query builder, transactions, bulk insert, table management, and backup

Category Functions Auth License

Why use this module?

The database module lets you:

  • Open a SQLite database (file or in-memory)
  • Close a database connection
  • Run a SELECT query and return all matching rows
  • Run a SELECT query and return only the first row
  • Execute an INSERT, UPDATE, DELETE, or DDL statement

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/database

Quick Start

No credentials needed — start using it right away:

database.close "mydb"

Available Functions

FunctionDescription
database.openOpen a SQLite database (file or in-memory)
database.closeClose a database connection
database.queryRun a SELECT query and return all matching rows
database.queryOneRun a SELECT query and return only the first row
database.executeExecute an INSERT, UPDATE, DELETE, or DDL statement
database.insertInsert a row using an object of column-value pairs
database.insertManyInsert multiple rows in a single transaction
database.updateUpdate rows matching a WHERE clause
database.removeDelete rows matching a WHERE clause
database.createTableCreate a new table with column definitions
database.dropTableDrop a table if it exists
database.listTablesList all tables in the database
database.tableInfoGet column information for a table
database.countCount rows in a table with optional WHERE conditions
database.transactionRun multiple SQL statements in a single atomic transaction
database.backupBackup the database to a file

Examples

Close a database connection

database.close "mydb"

Run a SELECT query and return all matching rows

database.query "mydb" "SELECT * FROM users WHERE age > ?" 18

Run a SELECT query and return only the first row

database.queryOne "mydb" "SELECT * FROM users WHERE id = ?" 1

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/database";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  database.close "mydb"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/database
Version0.1.0
LicenseMIT
Unpacked Size6.6 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities