Download the PHP package quasilyte/ksqlite without Composer

On this page you can find all versions of the php package quasilyte/ksqlite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ksqlite

KSQLite

Build Status

KSQLite is a FFI-based SQLite library that can be used in both PHP and KPHP.

Installation

Since this is a FFI library, it needs a dynamic library available during the run time.

Installation steps:

  1. Install libsqlite3 in your system (if you don't have it already)
  2. Locate the library file and place in under ./ffilibs/libsqlite3
  3. Install this composer package to use KSQLite classes inside your code

Depending on your system, you need to find libsqlite3.so, libsqlite3.dylib or libsqlite3.dll file. Then you can copy it to the application root ffilibs folder under the libsqlite3 name (note: no extension suffixes).

If you're having difficulties locating the library file, use a helper script:

Then install the composer library itself:

Notes:

Examples

Running examples with PHP:

Running examples with KPHP:

API reference

All functions report error with false return value (operation status).

When there is more than one result to be returned, a tuple like tuple(T, bool) is returned, where second tuple element is an operation status.

If operation status is false, use KSQLite::getLastError() to get the actual error message.

Note that you only need to care about closing the opened database object. There are no other resources you need to finalize. The API is designed in a way that you don't get any FFI-allocated object, so the library can manage these resources for you.

exec

When to use: need to execute a query once, but don't need the results.

execPrepared

When to use: running a single SQL statement with different params, don't need the results.

If you find prepared statements API too low-level, consider wrapping it in some helper functions.

fetch

If $row_func is null, default mapping behavior is used (rowAssoc).

When to use: execute a query once, collect results.

Notes:

fetchRow

When to use: execute a query once, collecting exactly one result row.

Note: if query returns more than one row, error will be reported. Either use LIMIT 1 or other ways to request only 1 row from the database, or use fetch() method and skip rest of the rows explicitely.

fetchRowAssoc

Like fetchRow, but result array has column name keys instead of indexes.

fetchColumn

When to use: execute a query once, collecting exactly one result column.

Note: if query returns more than one row or that row contains more than one value, error will be reported.

query

Unlike fetch-style API, it does not collect any results on its own. Use external state to do that.

When to use: when query results are needed, but fetch API is not flexible enough.

We're using KSQLiteArray here instead of a normal array since KPHP doesn't support by-reference closure captures.

queryPrepared

When to use: same advantages like with execPrepared, but here you can collect the results.


All versions of ksqlite with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
vkcom/kphp-polyfills Version ^1.0
quasilyte/kfinalize Version 1.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package quasilyte/ksqlite contains the following files

Loading the files please wait ....