Add column
static
addColumn
($conn, $table, $column, $type, $options)
-
$conn: Connection
-
$table: Table name
-
$column: Column name
-
$type: Column type
-
$options: Column options
Clear table data
static
clearData
($conn, $table, [$criteria = null])
-
$conn: Connection
-
$table: Table name
-
$criteria: Filter criteria
Copy data from table to table
static
copyData
($source_conn, $target_conn, $source_table, $target_table, $mapping, [$criteria = null], [$bulk_inserts = 1], [$auto_commit = false])
-
$source_conn: PDO source connection
-
$target_conn: PDO target connection
-
$source_table: Source table
-
$target_table: Target table
-
$mapping: Mapping between fields
-
$criteria: Filter criteria
-
$bulk_inserts: Inserts per time
-
$auto_commit: Auto commit after x inserts
Copy data from query to table
static
copyQuery
($source_conn, $target_conn, $query, $target_table, $mapping, [$prepared_values = null], [$bulk_inserts = 1], [$auto_commit = false])
-
$source_conn: PDO source connection
-
$target_conn: PDO target connection
-
$query: SQL Query
-
$target_table: Target table
-
$mapping: Mapping between fields
-
$prepared_values: Parameters for SQL Query
-
$bulk_inserts: Inserts per time
-
$auto_commit: Auto commit after x inserts
Count data from table
static
countData
($conn, $table, [$criteria = null])
-
$conn: PDO source connection
-
$table: Source table
-
$criteria: Filter criteria
Create table
static
createTable
($conn, $table, $columns)
-
$conn: Connection
-
$table: Table name
-
$columns: Array of columns
Drop column
static
dropColumn
($conn, $table, $column)
-
$conn: Connection
-
$table: Table name
-
$column: Column name
Drop table
static
dropTable
($conn, $table, [$ifexists = false])
-
$conn: Connection
-
$table: Table name
-
$ifexists: Drop only if exists
Execute SQL
static
execute
($conn, $query)
-
$conn: Connection
-
$query: SQL
Export data to CSV file
static
exportToFile
($source_conn, $source_table, $filename, $mapping, [$criteria = null], [$separator = ','])
-
$source_conn: Source connection
-
$source_table: Target table
-
$filename: CSV File to import
-
$mapping: Mapping between fields
-
$criteria: Select criteria
-
$separator: Columns separator [,]
Get RAW Data
static
getData
($conn, $query, [$mapping = null], [$prepared_values = null], [$action = null])
-
$conn: Connection
-
$query: SQL
-
$mapping: Mapping between fields
-
$prepared_values: Parameters for SQL Query
-
$action
Import data from CSV file
static
importFromFile
($filename, $target_conn, $target_table, $mapping, [$separator = ','], [$bulk_inserts = 1])
-
$filename: CSV File to import
-
$target_conn: Target connection
-
$target_table: Target table
-
$mapping: Mapping between fields
-
$separator: Columns separator [,]
-
$bulk_inserts
Insert data
static
insertData
($conn, $table, $values, [$avoid_criteria = null])
-
$conn: Connection
-
$table: Table name
-
$values: Array of values
-
$avoid_criteria: Criteria to avoid insertion
Update data
static
updateData
($conn, $table, $values, [$criteria = null])
-
$conn: Connection
-
$table: Table name
-
$values: Array of values
-
$criteria: Criteria to avoid insertion