Download the PHP package alexoliverwd/basic-sqlite without Composer

On this page you can find all versions of the php package alexoliverwd/basic-sqlite. 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 basic-sqlite

PHPUnit

Basic SQLite

Basic SQLite is a lightweight PHP helper class designed to simplify interaction with SQLite databases. It streamlines the process of connecting to, querying, and managing SQLite databases.

Installation

Preferred installation is via Composer:

Basic Usage

The constructor initializes a new instance of the class, setting up the connection to the specified SQLite database file. It performs validation to ensure the provided path points to a valid directory and constructs the full path to the SQLite file.

If the parsed directory exists but the specified SQLite file does not, the file will be created automatically.

When establishing a new class instance, the below methods are available:

TLDR

In summary, the example below demonstrates how to use the SQLite helper class to:

  1. Set up a database connection.
  2. Define a table schema.
  3. Insert records using prepared statements.
  4. Query the database.
  5. Close the connection.

Public Methods

The below methods are detailed descriptions, parameters, return types, and usage examples for each method.

__construct

Description

Initializes the SQLite class with a specified database location and optional pragmas.

Parameters

Pragma Defaults

By default, the following pragmas are set when initializing a new instance:

Returns

An instance of the SQLite class.

Example

registerColumn

Description

Is used to define a new column in the database table managed by the SQLite class. It supports various column attributes, such as type, nullability, and indexing.

Parameters

Return Value

This method does not return a value.

Example Usage

beginWriteTransaction

Description

Starts a write transaction for the SQLite database.

Returns

Void.

Example

close

Description

Closes the connection to the SQLite database.

Returns

Void.

Example

completeWriteTransaction

Description

Completes the current write transaction, committing any changes to the database.

Returns

Void.

Example

getColumns

Description

Retrieves a list of column names for the current table.

Returns

Array of column names.

Example

getCurrentTableName

Description

Retrieves the name of the current table being operated on.

Returns

The name of the current table as a string.

Example

getDatabaseLocation

Description

Retrieves the file path of the SQLite database.

Returns

The database file path as a string.

Example

getIndices

Description

Retrieves a list of indices for the current table.

Returns

Array of index names.

Example

getKeyFromName

Description

Finds the key corresponding to a given name in an array of items.

Parameters

Returns

The key corresponding to the given name.

Example

getNames

Description

Extracts names from an array of items.

Parameters

Returns

Array of names.

Example

hasColumn

Description

Checks whether a specified column exists in the current table.

Parameters

Returns

Boolean indicating whether the column exists.

Example

migrate

Description

Performs migrations to ensure the database schema is up-to-date.

Returns

Void.

Example

query

Description

Executes an SQL query on the database, with optional parameter binding and row return.

Parameters

Returns

Array of rows if $return_rows is true; otherwise, Void.

Example

queryIsWriteStatement

Description

Checks if a given query is a write operation (e.g., INSERT, UPDATE, DELETE).

Parameters

Returns

Boolean indicating whether the query is a write operation.

Example

setTableName

Description

Sets the name of the table to be used for subsequent operations.

Parameters

Returns

Void.

Example


All versions of basic-sqlite with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
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 alexoliverwd/basic-sqlite contains the following files

Loading the files please wait ....