https://github.com/sqlitecloud/sqlitecloud-php
PHP drivers for SQLiteCloud
https://github.com/sqlitecloud/sqlitecloud-php
cloud database sqlite
Last synced: 3 months ago
JSON representation
PHP drivers for SQLiteCloud
- Host: GitHub
- URL: https://github.com/sqlitecloud/sqlitecloud-php
- Owner: sqlitecloud
- Created: 2024-05-30T13:37:25.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-31T16:06:23.000Z (10 months ago)
- Last Synced: 2025-02-25T11:50:35.310Z (3 months ago)
- Topics: cloud, database, sqlite
- Language: PHP
- Homepage: https://sqlitecloud.io
- Size: 129 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Driver for SQLite Cloud
![]()
[](https://github.com/sqlitecloud/sqlitecloud-php/actions/workflows/deploy.yaml)
[](https://codecov.io/gh/sqlitecloud/sqlitecloud-php)
[](https://packagist.org/packages/sqlitecloud/sqlitecloud)
[](https://packagist.org/packages/sqlitecloud/sqlitecloud)- [Driver for SQLite Cloud](#driver-for-sqlite-cloud)
- [Example](#example)---
[SQLite Cloud](https://sqlitecloud.io) is a powerful PHP package that allows you to interact with the SQLite Cloud database seamlessly. It provides methods for various database operations. This package is designed to simplify database operations in PHP applications, making it easier than ever to work with SQLite Cloud.
- Documentation: [https://docs.sqlitecloud.io/docs/sdk/php](https://docs.sqlitecloud.io/docs/sdk/php/connect)
- Source: [https://github.com/sqlitecloud/sqlitecloud-php](https://github.com/sqlitecloud/sqlitecloud-php)
- Site: [https://sqlitecloud.io](https://sqlitecloud.io/developers)## Example
```bash
$ composer require sqlitecloud/sqlitecloud
``````php
connectWithString('sqlitecloud://myhost.sqlite.cloud:8860?apikey=myapikey');// You can autoselect the database during the connect call
// by adding the database name as path of the SQLite Cloud
// connection string, eg:
// $sqlite->connectWithString("sqlitecloud://myhost.sqlite.cloud:8860/mydatabase?apikey=myapikey");
$db_name = 'chinook.sqlite';
$sqlite->execute("USE DATABASE {$db_name}");/** @var SQLiteCloudRowset */
$rowset = $sqlite->execute('SELECT * FROM albums WHERE ArtistId = 2');printf('%d rows' . PHP_EOL, $rowset->nrows);
printf('%s | %s | %s' . PHP_EOL, $rowset->name(0), $rowset->name(1), $rowset->name(2));
for ($i = 0; $i < $rowset->nrows; $i++) {
printf('%s | %s | %s' . PHP_EOL, $rowset->value($i, 0), $rowset->value($i, 1), $rowset->value($i, 2));
}$sqlite->disconnect();
```