Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tursodatabase/turso-client-php

Repository files navigation

Shows a black logo in light color mode and a white one in dark color mode.

Turso + PHP

Turso + PHP (Community SDK)

SQLite for Production. Powered by libSQL.

MIT License Discord Contributors Total downloads Release

PHP Versions

PHP Versions Build Versions
8.1 TS / NTS
8.2 TS / NTS
8.3 TS / NTS
8.4 TS / NTS

Note: TS (Thread Safe), NTS (Non Thread-Safe). Support for: Linux/ Mac/Darwin / Windows/WSL


Installation

Installing the extension should be not complecated, it's easy and like using Composer Package Installer. Or, if you belive with this quotes:

If there is a hard way, why choose the easy way?

— Me

So you need to go with the Manual Installation.

Auto Installer turso-php-installer is a Composer package capable of executing various commands related to libSQL, simplifying the development process, and making it easier to simulate in a local environment.
composer global require darkterminal/turso-php-installer

Add to PATH variable:

export COMPOSER_BIN_DIR=$(composer config --global home)/vendor/bin

We have two options to install the extension using the installer:

Interactive Mode

turso-php-installer install

Non-interactive Mode

turso-php-installer install -n --php-version=8.3
Manual Installation

Download the latest build extension/driver binary you can see at release page.

  • Extract the archive
  • Locate somewhere in your machine
  • Copy a relative path that address that extension/driver
  • Open php.ini search ;extension if you using nano (ctrl+w) then searching for it
  • add in the next-line extension=liblibsql_php.so (in Linux) without ; at the begining

Check on your console/terminal

php --m | grep libsql

Development

Requirements

  • Unix/Unix Like
  • PHP >= 8.1
  • Rustlang
  • Git
  • Docker & Docker Compose (Docker Development)

Fork it First and Build from source:

# Clone
git clone git@github.com:<username>/turso-client-php.git
# Move to project directory
cd turso-client-php
# Make sure you have rust nightly toolchain
rustup toolchain install nightly
rustup default nightly 
# Build the binary
cargo build # or cargo build --release for production

Or using Develop inside Docker Container

# Clone
git clone git@github.com:<username>/turso-client-php.git
# Move to project directory
cd turso-client-php
# Build the binary
make compose/up

if using arm64 then use this command:

make compose-arm64/up

For all make command check make help

Contributors

Contributors

License

The MIT License (MIT). Please see License File for more information.

AltStyle によって変換されたページ (->オリジナル) /