1. Go to this page and download the library: Download ankane/seaduck library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ankane / seaduck example snippets
use SeaDuck\S3TablesCatalog;
$catalog = new S3TablesCatalog(arn: 'arn:aws:s3tables:...');
$catalog->sql('CREATE TABLE events (id bigint, name text)');
$catalog->sql("COPY events FROM 'data.csv'");
$catalog->attach('blog', 'postgres://localhost:5432/blog');
$catalog->sql('INSERT INTO events SELECT * FROM blog.events');
$catalog->sql('SELECT COUNT(*) FROM events')->toArray();
$catalog->listNamespaces();
$catalog->createNamespace('main');
$catalog->namespaceExists('main');
$catalog->dropNamespace('main');
$catalog->listTables();
$catalog->tableExists('events');
$catalog->dropTable('events');
$catalog->snapshots('events');
$catalog->sql('SELECT * FROM events AT (VERSION => ?)', [3]);
// or
$catalog->sql('SELECT * FROM events AT (TIMESTAMP => ?)', [new DateTime()]);
$catalog->sql('SELECT * FROM events WHERE id = ?', [1]);
$quotedTable = $catalog->quoteIdentifier('events');
$quotedFile = $catalog->quote('path/to/data.csv');
$catalog->sql("COPY $quotedTable FROM $quotedFile");
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.