Download the PHP package uk/db without Composer
On this page you can find all versions of the php package uk/db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package db
UK.DB
The UniKado database DB library
Usage
Version history
0.1.2
Fixing first issue #1
This adds 2 new methods to \UK\DB\Connection
- \UK\DB\Connection::getParseQueryVarsAlways() : bool
- \UK\DB\Connection::setParseQueryVarsAlways( bool $value )
The methods let you set or get a flag that declares if the parsing of used SQL query string for defined Query-Vars should be executed always. Otherwise it will only be parsed if there are some Query-Vars defined.
0.1.1
Introducing Query-Vars. (Pre prepared statements)
Query-Vars are key-value pairs, used to replace some placeholders inside an SQL query string with the associated string values.
Its like the regular known prepared statements but usable for query parts where prepared statements will not work. e.g. for an dynamic table name part or something else…
Placeholder format restrictions
Placeholders inside the SQL query string must:
- start with an open curly bracket, followed by the Dollar symbol
{$
and end with the closing curly bracket}
- be defined by the 2 parts placeholder-name and default value, separated by the equal sign
=
The default value is already used if no Query-Var is defined by PHP code.
If no default value should be used the equal sign is mandatory but it throws an exception if no replacement value is declared!
or 2 variants without an default value
Value format restrictions
- An Query-Vars value must be an string (not null or something else)
- It should not contain two following dashes
--
- Accepted chars are:
A-Za-z0-9 \t?_:.<=>-
For example:
If you want to use the following SQL
but the order direction part should be dynamic, you can use
Example to call this SQL command
v0.1
This is the initial first commit.