Turso Dabatabase Background Sync in the Background
Globally Install
composer global require darkterminal/turso-syncd
or you can install locally within your porject:
composer require darkterminal/turso-syncd
turso-syncd --database=<database_name> --organization=<organization_name> --token=<token> [--file_recorder=<file>] [--action_log_file=<file>] [--errors_log_file=<file>]
--database=<database_name>
or-d
: The name of the database.--organization=<organization_name>
or-o
: The name of the organization.--token=<token>
or-t
: The token for authentication.--file_recorder=<file>
: Specify file recorder.--action_log_file=<file>
: Specify action log file.--errors_log_file=<file>
: Specify errors log file.--help
: Display this help message.
<?php
use Darkterminal\TursoSyncd;
require_once "vendor/autoload.php";
$databaseName = "your-database-name";
$organizationName = "your-organization-name";
$token = "your-turso-token";
$config = [
'file_recorder' => "/path/to/your/recorder-file/recorded_queries.json",
'action_log_file' => "/path/to/your/action-log-file/actions.log",
'errors_log_file' => "/path/to/your/error-log-file/errors.log",
];
$tursoSyncd = new TursoSyncd($databaseName, $organizationName, $token, $config);
$tursoSyncd->start();