db

A clean, easy-to-use database framework for EZ Language. Provides SQLite database operations with CRUD helpers, query builders, transactions, and more.

databasesqliteormcrudquery 0 downloads owners: imabd645 MIT repository

Install

ez install db

Dependencies (1.0.0)

PackageRange
No dependencies.

Readme

EZ Database Library (EZDB)

A secure and powerful object-oriented SQLite wrapper for the EZ language.

Features

Installation

ez install db

Usage

use "db"

API Reference

Database Model

connect(path)

Opens or creates a SQLite database at the specified path.

query(sql, [params])

Executes a SELECT query and returns an array of dictionaries (rows).

execute(sql, [params])

Executes a command (INSERT, UPDATE, DELETE).

insert(table, data_dict)

Inserts a record using a dictionary. Returns the last inserted ID.

update(table, id, data_dict)

Updates a record by ID using a dictionary.

delete(table, id)

Deletes a record by ID.

begin() / commit() / rollback()

Standard transaction management.

Examples

use "db"

db = openDatabase("my_app.db")

// Schema
db.createTable("tasks", ["id INTEGER PRIMARY KEY", "title TEXT", "done BOOL"])

// Secure Insert
id = db.insert("tasks", {title: "Write README", done: false})

// Parameterized Query
results = db.query("SELECT * FROM tasks WHERE done = ?", [false])
get t in results {
    out t.title
}

db.disconnect()

Versions

VersionSizeDownloadsPublished
1.0.0 3.4 KB 0 1 hour ago

Integrity

sha256  07263a0ff7b49b0f6466996ba2a5b23a2c5a02daca6e7086eb764acca2789ada