SQL
- Full name:
\MammothPHP\WoollyM\IO\SQL
Properties
chunkSize
php
public int $chunkSizereplace
php
public bool $replaceignore
php
public bool $ignorepdo
php
public \PDO $pdoquery
php
public string $querypreparedStatement
php
protected \PDOStatement $preparedStatementstatementCacheKey
php
protected string $statementCacheKeyMethods
configurePdo
php
protected static configurePdo(\PDO $pdo): \PDO- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$pdo | \PDO |
fromSql
php
public static fromSql(\PDO $pdo, string $query): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$pdo | \PDO | |
$query | string |
import
php
public import(\MammothPHP\WoollyM\DataFrame $df = new DataFrame()): \MammothPHP\WoollyM\DataFrameParameters:
| Parameter | Type | Description |
|---|---|---|
$df | \MammothPHP\WoollyM\DataFrame |
toPDO
php
public toPDO(\PDO $pdo, string $tableName): voidParameters:
| Parameter | Type | Description |
|---|---|---|
$pdo | \PDO | |
$tableName | string |
options
php
public options(mixed $chunkSize = 500, mixed $replace = false, mixed $ignore = false): staticParameters:
| Parameter | Type | Description |
|---|---|---|
$chunkSize | mixed | - Insert chunk size |
$replace | mixed | - Use a sql replace statement |
$ignore | mixed | - Use a sql ignore statement |
insertInto
Performs a SQL insert transaction to provided table, crafting the SQL statement using an array of columns and a two-dimensional array of data.
php
protected insertInto(string $tableName): intParameters:
| Parameter | Type | Description |
|---|---|---|
$tableName | string |
Throws:
insertChunkedData
Transforms and executes a series of prepared statements from a chunked array.
php
protected insertChunkedData(string $tableName, array $columns, array $data): intParameters:
| Parameter | Type | Description |
|---|---|---|
$tableName | string | |
$columns | array | |
$data | array |
createPreparedStatement
Transforms a table string, array of columns, and array of data into a prepared statement.
php
protected createPreparedStatement(string $tableName, array $columns, int $rows): voidParameters:
| Parameter | Type | Description |
|---|---|---|
$tableName | string | |
$columns | array | |
$rows | int |
identifyAnyMissingColumns
Identifies any missing columns in the database which we may be attempting to insert.
php
protected identifyAnyMissingColumns(array $columns, string $tableName): voidParameters:
| Parameter | Type | Description |
|---|---|---|
$columns | array | |
$tableName | string |
Throws:
Inherited methods
fromDataFrame
php
public static fromDataFrame(\MammothPHP\WoollyM\DataFrame $df): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$df | \MammothPHP\WoollyM\DataFrame |
prepareToFileInput
php
protected prepareToFileInput(mixed $file, bool $overwriteFile): \SplFileObject|falseParameters:
| Parameter | Type | Description |
|---|---|---|
$file | mixed | |
$overwriteFile | bool |
Automatically generated on 2024-07-03