Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationzpe.lib.sqlite

The SQLite plugin provides access to SQLite databases using JDBC. It supports parameterised queries, transactions, and basic error reporting.

Objects

ZPESQLite

open (string path) ⇒ boolean
Opens (or creates) an SQLite database at the given file path. Returns true on success, otherwise false.
close () ⇒ boolean
Closes the current database connection. Returns true on success.
is_open () ⇒ boolean
Returns true if the database connection is currently open.
execute (string sql, list params) ⇒ number
Executes a parameterised SQL statement such as INSERT, UPDATE, or DELETE.

params is an optional list of values bound to ? placeholders.

Returns the number of rows affected.
query (string sql, list params) ⇒ list
Executes a parameterised SELECT query.

Returns a list of rows. Each row is represented as a map where keys are column names and values are the corresponding cell values.

If the query fails, an empty list is returned.
begin () ⇒ boolean
Begins a transaction. Returns true on success.
commit () ⇒ boolean
Commits the current transaction. Returns true on success.
rollback () ⇒ boolean
Rolls back the current transaction. Returns true on success.
last_insert_rowid () ⇒ number
Returns the row ID of the most recent successful INSERT. If unavailable, returns -1.
get_last_error () ⇒ string
Returns the message from the most recent database error. If no error has occurred, an empty string is returned.
Comments

There are no comments on this page.

New comment

Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.

Comments powered by BalfComment

Feedback 👍
Comments are sent via email to me.