PHP code example of lkt / timestream-connector

1. Go to this page and download the library: Download lkt/timestream-connector 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/ */

    

lkt / timestream-connector example snippets


use Lkt\Connectors\TimeStreamConnector;

TimeStreamConnector::define('aws')
    ->setUser('user')
    ->setPassword('password')
    ->setDatabase('database')
    ->setRegion('us-west-2');

use Lkt\Connectors\TimeStreamConnector;

TimeStreamConnector::get('aws')->query('your sql query');

use Lkt\Connectors\TimeStreamConnector;

TimeStreamConnector::get('aws')->write('table name', $records);

$records = [

    [
        'v1' => 123,
        'v2' => 345,
        'v3' => 999,
    ]
];