Turso + Doctrine DBAL
Set up Turso in your PHP + Doctrine DBAL project in minutes
Prerequisites
Before you start, make sure you:
- Install the Turso CLI
- Sign up or login to Turso
- Have an PHP Application with Doctrine DBAL
Download the latest build extension/driver binary you can see at Release page. It's available for:
- Linux
- Mac/Darwin
- Windows (WSL) / Devcontainer
Now, LibSQL
class is available in your PHP environment! You can use it everywhare in your PHP project 🎉
Configure database credentials
Get the database URL:
turso db show --url <database-name>
Get the database authentication token:
turso db tokens create <database-name>
Assign credentials to the environment variables inside .env
.
TURSO_DATABASE_URL=
TURSO_AUTH_TOKEN=
Create PHP Project
Create new directory:
mkdir your-awesome-php-project
cd your-awesome-php-project
Install Turso Doctrine DBAL
composer require tursodatabase/turso-doctrine-dbal
Configure database connection
Setup the environment variable in your Laravel application, choose what the type connection you need.
Other environment variables (Embedded Replica Only)
Project Structure Example
src/
├── helpers.php
└── Todo.php
vendor/
composer.json
composer.lock
todo # todo executable
Here you simple php todo cli + Doctrine BDAL
Your PHP Application Ready!
Examples
Was this page helpful?