diff --git a/apiDocumentation/classes.html b/apiDocumentation/classes.html index fd8e476..6fd35fd 100644 --- a/apiDocumentation/classes.html +++ b/apiDocumentation/classes.html @@ -123,6 +123,14 @@ EMPTY + + + MapType + + 'Enum' of query map types + EMPTY + + QueryBuilder @@ -131,6 +139,16 @@ EMPTY + + + QueryBuilderBase + + + No description available + + EMPTY + + QueryParser @@ -139,6 +157,14 @@ EMPTY + + + QueryType + + 'Enum' of query types + EMPTY + + State @@ -342,7 +368,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException.html b/apiDocumentation/classes/BadFunctionCallException.html index 5307ea7..fb433fa 100644 --- a/apiDocumentation/classes/BadFunctionCallException.html +++ b/apiDocumentation/classes/BadFunctionCallException.html @@ -118,7 +118,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/__clone.html b/apiDocumentation/classes/BadFunctionCallException/__clone.html index f9dd13a..89114bc 100644 --- a/apiDocumentation/classes/BadFunctionCallException/__clone.html +++ b/apiDocumentation/classes/BadFunctionCallException/__clone.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/__toString.html b/apiDocumentation/classes/BadFunctionCallException/__toString.html index 002884d..cd5b401 100644 --- a/apiDocumentation/classes/BadFunctionCallException/__toString.html +++ b/apiDocumentation/classes/BadFunctionCallException/__toString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/getCode.html b/apiDocumentation/classes/BadFunctionCallException/getCode.html index 2c00e6e..8be7fec 100644 --- a/apiDocumentation/classes/BadFunctionCallException/getCode.html +++ b/apiDocumentation/classes/BadFunctionCallException/getCode.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/getFile.html b/apiDocumentation/classes/BadFunctionCallException/getFile.html index cfba381..7bf2ec3 100644 --- a/apiDocumentation/classes/BadFunctionCallException/getFile.html +++ b/apiDocumentation/classes/BadFunctionCallException/getFile.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/getLine.html b/apiDocumentation/classes/BadFunctionCallException/getLine.html index 16da979..938edef 100644 --- a/apiDocumentation/classes/BadFunctionCallException/getLine.html +++ b/apiDocumentation/classes/BadFunctionCallException/getLine.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/getMessage.html b/apiDocumentation/classes/BadFunctionCallException/getMessage.html index d8830cd..cb6f6fc 100644 --- a/apiDocumentation/classes/BadFunctionCallException/getMessage.html +++ b/apiDocumentation/classes/BadFunctionCallException/getMessage.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/getPrevious.html b/apiDocumentation/classes/BadFunctionCallException/getPrevious.html index 7658d81..9181b0a 100644 --- a/apiDocumentation/classes/BadFunctionCallException/getPrevious.html +++ b/apiDocumentation/classes/BadFunctionCallException/getPrevious.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/getTrace.html b/apiDocumentation/classes/BadFunctionCallException/getTrace.html index d902609..83ab57f 100644 --- a/apiDocumentation/classes/BadFunctionCallException/getTrace.html +++ b/apiDocumentation/classes/BadFunctionCallException/getTrace.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadFunctionCallException/getTraceAsString.html b/apiDocumentation/classes/BadFunctionCallException/getTraceAsString.html index c630632..9690ba9 100644 --- a/apiDocumentation/classes/BadFunctionCallException/getTraceAsString.html +++ b/apiDocumentation/classes/BadFunctionCallException/getTraceAsString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException.html b/apiDocumentation/classes/BadMethodCallException.html index 1d4b748..80a1018 100644 --- a/apiDocumentation/classes/BadMethodCallException.html +++ b/apiDocumentation/classes/BadMethodCallException.html @@ -118,7 +118,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/__clone.html b/apiDocumentation/classes/BadMethodCallException/__clone.html index b023e5f..4737371 100644 --- a/apiDocumentation/classes/BadMethodCallException/__clone.html +++ b/apiDocumentation/classes/BadMethodCallException/__clone.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/__toString.html b/apiDocumentation/classes/BadMethodCallException/__toString.html index 565f309..895ee39 100644 --- a/apiDocumentation/classes/BadMethodCallException/__toString.html +++ b/apiDocumentation/classes/BadMethodCallException/__toString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/getCode.html b/apiDocumentation/classes/BadMethodCallException/getCode.html index 0c3afc3..15bd3e1 100644 --- a/apiDocumentation/classes/BadMethodCallException/getCode.html +++ b/apiDocumentation/classes/BadMethodCallException/getCode.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/getFile.html b/apiDocumentation/classes/BadMethodCallException/getFile.html index f1ef48e..0fb9396 100644 --- a/apiDocumentation/classes/BadMethodCallException/getFile.html +++ b/apiDocumentation/classes/BadMethodCallException/getFile.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/getLine.html b/apiDocumentation/classes/BadMethodCallException/getLine.html index cdcfa18..3cc1841 100644 --- a/apiDocumentation/classes/BadMethodCallException/getLine.html +++ b/apiDocumentation/classes/BadMethodCallException/getLine.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/getMessage.html b/apiDocumentation/classes/BadMethodCallException/getMessage.html index 299c29d..b995cb9 100644 --- a/apiDocumentation/classes/BadMethodCallException/getMessage.html +++ b/apiDocumentation/classes/BadMethodCallException/getMessage.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/getPrevious.html b/apiDocumentation/classes/BadMethodCallException/getPrevious.html index 6b5f25f..4464b99 100644 --- a/apiDocumentation/classes/BadMethodCallException/getPrevious.html +++ b/apiDocumentation/classes/BadMethodCallException/getPrevious.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/getTrace.html b/apiDocumentation/classes/BadMethodCallException/getTrace.html index 4586732..f8cee5e 100644 --- a/apiDocumentation/classes/BadMethodCallException/getTrace.html +++ b/apiDocumentation/classes/BadMethodCallException/getTrace.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/BadMethodCallException/getTraceAsString.html b/apiDocumentation/classes/BadMethodCallException/getTraceAsString.html index 84d9d4b..df0b650 100644 --- a/apiDocumentation/classes/BadMethodCallException/getTraceAsString.html +++ b/apiDocumentation/classes/BadMethodCallException/getTraceAsString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception.html b/apiDocumentation/classes/Exception.html index 3a73abc..677ebe0 100644 --- a/apiDocumentation/classes/Exception.html +++ b/apiDocumentation/classes/Exception.html @@ -100,7 +100,7 @@ diff --git a/apiDocumentation/classes/Exception/__clone.html b/apiDocumentation/classes/Exception/__clone.html index d80c491..a3cfdea 100644 --- a/apiDocumentation/classes/Exception/__clone.html +++ b/apiDocumentation/classes/Exception/__clone.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/__construct.html b/apiDocumentation/classes/Exception/__construct.html index 06e03fd..cda313e 100644 --- a/apiDocumentation/classes/Exception/__construct.html +++ b/apiDocumentation/classes/Exception/__construct.html @@ -101,7 +101,7 @@ diff --git a/apiDocumentation/classes/Exception/__toString.html b/apiDocumentation/classes/Exception/__toString.html index 2a2d411..16976d2 100644 --- a/apiDocumentation/classes/Exception/__toString.html +++ b/apiDocumentation/classes/Exception/__toString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/getCode.html b/apiDocumentation/classes/Exception/getCode.html index 43da32d..9850614 100644 --- a/apiDocumentation/classes/Exception/getCode.html +++ b/apiDocumentation/classes/Exception/getCode.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/getFile.html b/apiDocumentation/classes/Exception/getFile.html index f54e429..40c4e9f 100644 --- a/apiDocumentation/classes/Exception/getFile.html +++ b/apiDocumentation/classes/Exception/getFile.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/getLine.html b/apiDocumentation/classes/Exception/getLine.html index 000c547..f1fee9e 100644 --- a/apiDocumentation/classes/Exception/getLine.html +++ b/apiDocumentation/classes/Exception/getLine.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/getMessage.html b/apiDocumentation/classes/Exception/getMessage.html index d3bc172..0fdb83f 100644 --- a/apiDocumentation/classes/Exception/getMessage.html +++ b/apiDocumentation/classes/Exception/getMessage.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/getPrevious.html b/apiDocumentation/classes/Exception/getPrevious.html index 6db319f..b9d99d2 100644 --- a/apiDocumentation/classes/Exception/getPrevious.html +++ b/apiDocumentation/classes/Exception/getPrevious.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/getTrace.html b/apiDocumentation/classes/Exception/getTrace.html index 0df4694..c9affd2 100644 --- a/apiDocumentation/classes/Exception/getTrace.html +++ b/apiDocumentation/classes/Exception/getTrace.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/Exception/getTraceAsString.html b/apiDocumentation/classes/Exception/getTraceAsString.html index 8c2d59c..80d1174 100644 --- a/apiDocumentation/classes/Exception/getTraceAsString.html +++ b/apiDocumentation/classes/Exception/getTraceAsString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException.html b/apiDocumentation/classes/InvalidArgumentException.html index ff00b39..8321743 100644 --- a/apiDocumentation/classes/InvalidArgumentException.html +++ b/apiDocumentation/classes/InvalidArgumentException.html @@ -118,7 +118,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/__clone.html b/apiDocumentation/classes/InvalidArgumentException/__clone.html index 19c96b2..d2b6cb0 100644 --- a/apiDocumentation/classes/InvalidArgumentException/__clone.html +++ b/apiDocumentation/classes/InvalidArgumentException/__clone.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/__toString.html b/apiDocumentation/classes/InvalidArgumentException/__toString.html index 72bb6d8..2fb076e 100644 --- a/apiDocumentation/classes/InvalidArgumentException/__toString.html +++ b/apiDocumentation/classes/InvalidArgumentException/__toString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/getCode.html b/apiDocumentation/classes/InvalidArgumentException/getCode.html index b90c583..b7a5824 100644 --- a/apiDocumentation/classes/InvalidArgumentException/getCode.html +++ b/apiDocumentation/classes/InvalidArgumentException/getCode.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/getFile.html b/apiDocumentation/classes/InvalidArgumentException/getFile.html index a878281..10781f0 100644 --- a/apiDocumentation/classes/InvalidArgumentException/getFile.html +++ b/apiDocumentation/classes/InvalidArgumentException/getFile.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/getLine.html b/apiDocumentation/classes/InvalidArgumentException/getLine.html index 0c5201b..be9655f 100644 --- a/apiDocumentation/classes/InvalidArgumentException/getLine.html +++ b/apiDocumentation/classes/InvalidArgumentException/getLine.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/getMessage.html b/apiDocumentation/classes/InvalidArgumentException/getMessage.html index 0130a69..ee99f2a 100644 --- a/apiDocumentation/classes/InvalidArgumentException/getMessage.html +++ b/apiDocumentation/classes/InvalidArgumentException/getMessage.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/getPrevious.html b/apiDocumentation/classes/InvalidArgumentException/getPrevious.html index 53753cf..ad1b586 100644 --- a/apiDocumentation/classes/InvalidArgumentException/getPrevious.html +++ b/apiDocumentation/classes/InvalidArgumentException/getPrevious.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/getTrace.html b/apiDocumentation/classes/InvalidArgumentException/getTrace.html index cefa142..ba803dc 100644 --- a/apiDocumentation/classes/InvalidArgumentException/getTrace.html +++ b/apiDocumentation/classes/InvalidArgumentException/getTrace.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/InvalidArgumentException/getTraceAsString.html b/apiDocumentation/classes/InvalidArgumentException/getTraceAsString.html index 8daa741..dbca1f8 100644 --- a/apiDocumentation/classes/InvalidArgumentException/getTraceAsString.html +++ b/apiDocumentation/classes/InvalidArgumentException/getTraceAsString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException.html b/apiDocumentation/classes/LogicException.html index 4edfa66..5b6dc80 100644 --- a/apiDocumentation/classes/LogicException.html +++ b/apiDocumentation/classes/LogicException.html @@ -118,7 +118,7 @@ diff --git a/apiDocumentation/classes/LogicException/__clone.html b/apiDocumentation/classes/LogicException/__clone.html index 7dfae12..f554b3a 100644 --- a/apiDocumentation/classes/LogicException/__clone.html +++ b/apiDocumentation/classes/LogicException/__clone.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/__toString.html b/apiDocumentation/classes/LogicException/__toString.html index 70abcda..5e1ad1e 100644 --- a/apiDocumentation/classes/LogicException/__toString.html +++ b/apiDocumentation/classes/LogicException/__toString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/getCode.html b/apiDocumentation/classes/LogicException/getCode.html index 989021c..059cfad 100644 --- a/apiDocumentation/classes/LogicException/getCode.html +++ b/apiDocumentation/classes/LogicException/getCode.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/getFile.html b/apiDocumentation/classes/LogicException/getFile.html index 019ed3b..6eb7de7 100644 --- a/apiDocumentation/classes/LogicException/getFile.html +++ b/apiDocumentation/classes/LogicException/getFile.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/getLine.html b/apiDocumentation/classes/LogicException/getLine.html index e023288..79fdb4a 100644 --- a/apiDocumentation/classes/LogicException/getLine.html +++ b/apiDocumentation/classes/LogicException/getLine.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/getMessage.html b/apiDocumentation/classes/LogicException/getMessage.html index 383556a..1500f30 100644 --- a/apiDocumentation/classes/LogicException/getMessage.html +++ b/apiDocumentation/classes/LogicException/getMessage.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/getPrevious.html b/apiDocumentation/classes/LogicException/getPrevious.html index 3634801..8a5c17a 100644 --- a/apiDocumentation/classes/LogicException/getPrevious.html +++ b/apiDocumentation/classes/LogicException/getPrevious.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/getTrace.html b/apiDocumentation/classes/LogicException/getTrace.html index 4362d12..5883fb6 100644 --- a/apiDocumentation/classes/LogicException/getTrace.html +++ b/apiDocumentation/classes/LogicException/getTrace.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/LogicException/getTraceAsString.html b/apiDocumentation/classes/LogicException/getTraceAsString.html index bb7c838..b3d0bba 100644 --- a/apiDocumentation/classes/LogicException/getTraceAsString.html +++ b/apiDocumentation/classes/LogicException/getTraceAsString.html @@ -78,7 +78,7 @@ diff --git a/apiDocumentation/classes/PDO.html b/apiDocumentation/classes/PDO.html index ca32aee..f49ce43 100644 --- a/apiDocumentation/classes/PDO.html +++ b/apiDocumentation/classes/PDO.html @@ -147,7 +147,7 @@ diff --git a/apiDocumentation/classes/PDO/__construct.html b/apiDocumentation/classes/PDO/__construct.html index c562f04..c7f053e 100644 --- a/apiDocumentation/classes/PDO/__construct.html +++ b/apiDocumentation/classes/PDO/__construct.html @@ -109,7 +109,7 @@ diff --git a/apiDocumentation/classes/PDO/beginTransaction.html b/apiDocumentation/classes/PDO/beginTransaction.html index 5398d2e..0e2bf49 100644 --- a/apiDocumentation/classes/PDO/beginTransaction.html +++ b/apiDocumentation/classes/PDO/beginTransaction.html @@ -80,7 +80,7 @@ diff --git a/apiDocumentation/classes/PDO/commit.html b/apiDocumentation/classes/PDO/commit.html index d6ca268..e7f5123 100644 --- a/apiDocumentation/classes/PDO/commit.html +++ b/apiDocumentation/classes/PDO/commit.html @@ -80,7 +80,7 @@ diff --git a/apiDocumentation/classes/PDO/errorCode.html b/apiDocumentation/classes/PDO/errorCode.html index c602ef4..5f11e9d 100644 --- a/apiDocumentation/classes/PDO/errorCode.html +++ b/apiDocumentation/classes/PDO/errorCode.html @@ -80,7 +80,7 @@ diff --git a/apiDocumentation/classes/PDO/errorInfo.html b/apiDocumentation/classes/PDO/errorInfo.html index 9af7a16..071a726 100644 --- a/apiDocumentation/classes/PDO/errorInfo.html +++ b/apiDocumentation/classes/PDO/errorInfo.html @@ -80,7 +80,7 @@ diff --git a/apiDocumentation/classes/PDO/exec.html b/apiDocumentation/classes/PDO/exec.html index cf0f5d9..2f94412 100644 --- a/apiDocumentation/classes/PDO/exec.html +++ b/apiDocumentation/classes/PDO/exec.html @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/PDO/getAttribute.html b/apiDocumentation/classes/PDO/getAttribute.html index c11b386..460407f 100644 --- a/apiDocumentation/classes/PDO/getAttribute.html +++ b/apiDocumentation/classes/PDO/getAttribute.html @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/PDO/getAvailableDrivers.html b/apiDocumentation/classes/PDO/getAvailableDrivers.html index 8c6c25e..1f28249 100644 --- a/apiDocumentation/classes/PDO/getAvailableDrivers.html +++ b/apiDocumentation/classes/PDO/getAvailableDrivers.html @@ -80,7 +80,7 @@ diff --git a/apiDocumentation/classes/PDO/inTransaction.html b/apiDocumentation/classes/PDO/inTransaction.html index db11592..90e3c99 100644 --- a/apiDocumentation/classes/PDO/inTransaction.html +++ b/apiDocumentation/classes/PDO/inTransaction.html @@ -80,7 +80,7 @@ diff --git a/apiDocumentation/classes/PDO/lastInsertId.html b/apiDocumentation/classes/PDO/lastInsertId.html index f71ece3..9a5bbc8 100644 --- a/apiDocumentation/classes/PDO/lastInsertId.html +++ b/apiDocumentation/classes/PDO/lastInsertId.html @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/PDO/prepare.html b/apiDocumentation/classes/PDO/prepare.html index 01f9aa5..13aadd4 100644 --- a/apiDocumentation/classes/PDO/prepare.html +++ b/apiDocumentation/classes/PDO/prepare.html @@ -97,7 +97,7 @@ diff --git a/apiDocumentation/classes/PDO/query.html b/apiDocumentation/classes/PDO/query.html index 0b86ff0..f8f0958 100644 --- a/apiDocumentation/classes/PDO/query.html +++ b/apiDocumentation/classes/PDO/query.html @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/PDO/quote.html b/apiDocumentation/classes/PDO/quote.html index 0327710..63640b4 100644 --- a/apiDocumentation/classes/PDO/quote.html +++ b/apiDocumentation/classes/PDO/quote.html @@ -97,7 +97,7 @@ diff --git a/apiDocumentation/classes/PDO/rollBack.html b/apiDocumentation/classes/PDO/rollBack.html index c4bd943..c59ea7c 100644 --- a/apiDocumentation/classes/PDO/rollBack.html +++ b/apiDocumentation/classes/PDO/rollBack.html @@ -80,7 +80,7 @@ diff --git a/apiDocumentation/classes/PDO/setAttribute.html b/apiDocumentation/classes/PDO/setAttribute.html index 40f9eb8..27577f4 100644 --- a/apiDocumentation/classes/PDO/setAttribute.html +++ b/apiDocumentation/classes/PDO/setAttribute.html @@ -97,7 +97,7 @@ diff --git a/apiDocumentation/classes/Query_ConnectionManager.html b/apiDocumentation/classes/Query_ConnectionManager.html index 5b51f27..a25875b 100644 --- a/apiDocumentation/classes/Query_ConnectionManager.html +++ b/apiDocumentation/classes/Query_ConnectionManager.html @@ -56,10 +56,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -100,173 +97,10 @@ — Parses params into a dsn and option array -

    History

    - diff --git a/apiDocumentation/classes/Query_ConnectionManager/__clone.html b/apiDocumentation/classes/Query_ConnectionManager/__clone.html index b3ec81f..36de8d4 100644 --- a/apiDocumentation/classes/Query_ConnectionManager/__clone.html +++ b/apiDocumentation/classes/Query_ConnectionManager/__clone.html @@ -62,7 +62,7 @@ Throws
  • - Source + Source
  • @@ -94,7 +94,7 @@ diff --git a/apiDocumentation/classes/Query_ConnectionManager/__sleep.html b/apiDocumentation/classes/Query_ConnectionManager/__sleep.html index e7b7da9..fb39efd 100644 --- a/apiDocumentation/classes/Query_ConnectionManager/__sleep.html +++ b/apiDocumentation/classes/Query_ConnectionManager/__sleep.html @@ -62,7 +62,7 @@ Throws
  • - Source + Source
  • @@ -94,7 +94,7 @@ diff --git a/apiDocumentation/classes/Query_ConnectionManager/__wakeup.html b/apiDocumentation/classes/Query_ConnectionManager/__wakeup.html index 15c242e..2a3af6d 100644 --- a/apiDocumentation/classes/Query_ConnectionManager/__wakeup.html +++ b/apiDocumentation/classes/Query_ConnectionManager/__wakeup.html @@ -62,7 +62,7 @@ Throws
  • - Source + Source
  • @@ -94,7 +94,7 @@ diff --git a/apiDocumentation/classes/Query_ConnectionManager/connect.html b/apiDocumentation/classes/Query_ConnectionManager/connect.html index db37cdb..4afee89 100644 --- a/apiDocumentation/classes/Query_ConnectionManager/connect.html +++ b/apiDocumentation/classes/Query_ConnectionManager/connect.html @@ -65,7 +65,7 @@ Throws
  • - Source + Source
  • @@ -76,7 +76,7 @@ @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/classes/Query_ConnectionManager/getInstance.html b/apiDocumentation/classes/Query_ConnectionManager/getInstance.html index cdc179e..3051d8b 100644 --- a/apiDocumentation/classes/Query_ConnectionManager/getInstance.html +++ b/apiDocumentation/classes/Query_ConnectionManager/getInstance.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/classes/Query_ConnectionManager/parseParams.html b/apiDocumentation/classes/Query_ConnectionManager/parseParams.html index b5759b1..91993a1 100644 --- a/apiDocumentation/classes/Query_ConnectionManager/parseParams.html +++ b/apiDocumentation/classes/Query_ConnectionManager/parseParams.html @@ -65,7 +65,7 @@ Throws
  • - Source + Source
  • @@ -76,16 +76,16 @@ @@ -102,11 +102,13 @@
  • public ?array getFks()
  • public ?array getIndexes()
  • public ?array getTypes() +
  • public string getVersion()
  • public ?array driverQuery()
  • public ?int numRows()
  • public array insertBatch()
  • public array updateBatch()
  • public PDOStatement truncate() +
  • public string returning()
  • public mixed _quote()
  • +

    Violations

    +
    +

    Checkstyle

    + + + + + + + + + + + + + + + + + + + + + +
    LineColumnSeverityMessage
    33323 + error + Short array syntax must be used to define arrays
    33344 + error + Short array syntax must be used to define arrays
    +

    Methods

    public

    @@ -185,6 +217,8 @@ — Retrieve list of data types for the database
  • getUtil() — Get the Util class for the current driver
  • +
  • getVersion() + — Get the version of the database engine
  • getViews() — Return list of views for the current database
  • insertBatch() @@ -201,6 +235,8 @@ — Surrounds the string with the databases identifier escape characters
  • quoteTable() — Quote database table name, and set prefix
  • +
  • returning() + — Generate the returning clause for the current database
  • setLastQuery() — Set the last query sql
  • setTablePrefix() @@ -271,173 +307,10 @@
  • -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/__call.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/__call.html index b4eac70..5bc9b35 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/__call.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/__call.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/__construct.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/__construct.html index ff2cb84..2debb1e 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/__construct.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/__construct.html @@ -59,7 +59,7 @@ Parameter
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/_quote.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/_quote.html index 9ef3e28..9131125 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/_quote.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/_quote.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/affectedRows.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/affectedRows.html index 458521e..079b8f3 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/affectedRows.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/affectedRows.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/driverQuery.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/driverQuery.html index 6470fb0..ba419b0 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/driverQuery.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/driverQuery.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -108,7 +108,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getColumns.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getColumns.html index bbdfc00..87204d1 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getColumns.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getColumns.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getDbs.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getDbs.html index 0c2e25c..3679477 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getDbs.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getDbs.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFks.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFks.html index 58b5120..7f1dfa1 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFks.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFks.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFunctions.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFunctions.html index 9f6ecac..f44d7c4 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFunctions.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getFunctions.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getIndexes.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getIndexes.html index e0ae8df..e0f0981 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getIndexes.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getIndexes.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getLastQuery.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getLastQuery.html index 77cd3f0..5eeb2fa 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getLastQuery.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getLastQuery.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getProcedures.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getProcedures.html index 9ca44c0..d9fd5f1 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getProcedures.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getProcedures.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSchemas.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSchemas.html index d666ff1..6307ebf 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSchemas.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSchemas.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSequences.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSequences.html index 2a9184e..6f68aba 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSequences.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSequences.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSql.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSql.html index a91a2d7..0dc6479 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSql.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSql.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -91,7 +91,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSystemTables.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSystemTables.html index 66f6369..a77874d 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSystemTables.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getSystemTables.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTables.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTables.html index a03cfce..53bbb26 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTables.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTables.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTriggers.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTriggers.html index ae3b5a2..a4669a1 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTriggers.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTriggers.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTypes.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTypes.html index b1bb6fe..e1cf554 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTypes.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getTypes.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getUtil.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getUtil.html index ca816b5..1027d3d 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getUtil.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getUtil.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -91,7 +91,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_State/setFromString.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getVersion.html similarity index 68% rename from apiDocumentation/classes/Query_State/setFromString.html rename to apiDocumentation/classes/Query_Drivers_AbstractDriver/getVersion.html index 44e6883..309e779 100644 --- a/apiDocumentation/classes/Query_State/setFromString.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getVersion.html @@ -2,7 +2,7 @@ - phpDox - Query\State::setFromString + phpDox - Query\Drivers\AbstractDriver::getVersion @@ -39,12 +39,12 @@ Classes
  • - Query + Query\Drivers
  • - State + AbstractDriver
  • -
  • setFromString
  • +
  • getVersion
  • -

    Query\State::setFromString

    -

    +

    Query\Drivers\AbstractDriver::getVersion

    +

    Get the version of the database engine

      Signature

      - public function setFromString(string - $fromString ) + public function getVersion()
      -

      Parameters

      -
      -
      $fromString - — - string
      -
      -

      Returns

      -
      State
      -

      -
      +
      string
      +
      +

      Defined by Interface

      +

      + + DriverInterface + +

    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getViews.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getViews.html index efb7278..b59f4dc 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/getViews.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/getViews.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/insertBatch.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/insertBatch.html index 397b8e4..23bd78d 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/insertBatch.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/insertBatch.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -108,7 +108,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/numRows.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/numRows.html index a6f7d05..f1c9469 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/numRows.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/numRows.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -91,7 +91,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/prefixTable.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/prefixTable.html index 4f3e25c..9b96dca 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/prefixTable.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/prefixTable.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareExecute.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareExecute.html index 9aa41b9..48b1fa4 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareExecute.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareExecute.html @@ -68,7 +68,7 @@ Interface
  • - Source + Source
  • @@ -120,7 +120,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareQuery.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareQuery.html index 57709da..5ffefe7 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareQuery.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/prepareQuery.html @@ -68,7 +68,7 @@ Interface
  • - Source + Source
  • @@ -120,7 +120,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteIdent.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteIdent.html index e0864bb..e33c8bf 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteIdent.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteIdent.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -99,10 +99,40 @@ DriverInterface

    +

    Violations

    +
    +

    Checkstyle

    + + + + + + + + + + + + + + + + + + + + + +
    LineColumnSeverityMessage
    33323 + error + Short array syntax must be used to define arrays
    33344 + error + Short array syntax must be used to define arrays
    +
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteTable.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteTable.html index a2327df..512a616 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteTable.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/quoteTable.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_State/setOrderString.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/returning.html similarity index 72% rename from apiDocumentation/classes/Query_State/setOrderString.html rename to apiDocumentation/classes/Query_Drivers_AbstractDriver/returning.html index a169dec..29e1881 100644 --- a/apiDocumentation/classes/Query_State/setOrderString.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/returning.html @@ -2,7 +2,7 @@ - phpDox - Query\State::setOrderString + phpDox - Query\Drivers\AbstractDriver::returning @@ -39,12 +39,12 @@ Classes
  • - Query + Query\Drivers
  • - State + AbstractDriver
  • -
  • setOrderString
  • +
  • returning
  • -

    Query\State::setOrderString

    -

    +

    Query\Drivers\AbstractDriver::returning

    +

    Generate the returning clause for the current database

      Signature

      - public function setOrderString(string - $orderString ) + public function returning(string + $query, + string + $select )

      Parameters

      -
      $orderString +
      $query + — + string
      +
      +
      $select — string

      Returns

      -
      State
      -

      -
      +
      string
      +
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/setLastQuery.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/setLastQuery.html index ce216a1..5b23953 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/setLastQuery.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/setLastQuery.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/setTablePrefix.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/setTablePrefix.html index 09e2788..4da288e 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/setTablePrefix.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/setTablePrefix.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/truncate.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/truncate.html index 2737da3..63affe3 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/truncate.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/truncate.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractDriver/updateBatch.html b/apiDocumentation/classes/Query_Drivers_AbstractDriver/updateBatch.html index beb6e8d..0a6e26b 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractDriver/updateBatch.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractDriver/updateBatch.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -114,7 +114,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractSQL.html b/apiDocumentation/classes/Query_Drivers_AbstractSQL.html index 6c44de9..66ffc72 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractSQL.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractSQL.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -96,173 +93,10 @@ — Limit clause -

    History

    -
      -
    • -

      2018-01-24T15:03:41-05:00 (commit #f967aaf)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Remove method separators, update documentation building configuration
      -
      -
    • -
    • -

      2018-01-24T13:14:03-05:00 (commit #1d583bc)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Add more type hinting
      -
      -
    • -
    • -

      2018-01-19T15:47:34-05:00 (commit #369ca6e)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Flatten source structure a bit
      -
      -
    • -
    • -

      2018-01-19T13:43:19-05:00 (commit #c735c27)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update file headers
      -
      -
    • -
    • -

      2016-10-13T21:55:23-04:00 (commit #b8d4768)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      camelCase methods and properties
      -
      -
    • -
    • -

      2016-10-12T22:12:25-04:00 (commit #6740aae)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      PHP7 or bust!
      -
      -
    • -
    • -

      2016-09-07T17:39:19-04:00 (commit #ca60162)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Miscellaneous cleanup and refactoring
      -
      -
    • -
    • -

      2016-09-07T13:17:17-04:00 (commit #24f3b1d)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update header comments
      -
      -
    • -
    • -

      2015-11-10T20:59:03-05:00 (commit #2613a1c)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update lots of comments
      -
      -
    • -
    • -

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Make class names Pascal Case
      -
      -
    • -
    • -

      2015-07-29T16:51:17-04:00 (commit #8511c6a)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Move library into src folder, fix simpletest test runner
      -
      -
    • -
    • -

      2015-07-16T16:56:13-04:00 (commit #bfc3ea3)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Reorganize drivers into a more modern layout
      -
      -
    • -
    • -

      2014-08-08T13:48:20-04:00 (commit #dd672df)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Reorganize classes to autoload by namespace
      -
      -
    • -
    • -

      2014-04-24T15:32:09-04:00 (commit #17354ee)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Move SQL and Util classes to their own namespaces
      -
      -
    • -
    • -

      2014-04-23T15:53:16-04:00 (commit #aa5aa8e)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Docblock fixes and more dependency injection
      -
      -
    • -
    • -

      2014-04-08T17:13:41-04:00 (commit #74d4a00)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Test improvements
      -
      -
    • -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractSQL/limit.html b/apiDocumentation/classes/Query_Drivers_AbstractSQL/limit.html index b92cf27..84ac4b1 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractSQL/limit.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractSQL/limit.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -80,8 +80,8 @@ $sql, int $limit, - [boolean - $offset = FALSE] ) + [int + $offset = NULL] )

    Parameters

    @@ -96,8 +96,8 @@
    $offset — - boolean
    -



    + int +

    Returns

    @@ -113,7 +113,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractUtil.html b/apiDocumentation/classes/Query_Drivers_AbstractUtil.html index e218006..4f747b7 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractUtil.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractUtil.html @@ -56,10 +56,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -97,173 +94,10 @@ — Get the driver object for the current connection -

    History

    -
      -
    • -

      2018-01-26T08:39:30-05:00 (commit #3067976)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Add updateBatch method
      -
      -
    • -
    • -

      2018-01-24T13:14:03-05:00 (commit #1d583bc)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Add more type hinting
      -
      -
    • -
    • -

      2018-01-22T15:43:56-05:00 (commit #91eb812)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Various refactoring
      -
      -
    • -
    • -

      2018-01-19T15:47:34-05:00 (commit #369ca6e)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Flatten source structure a bit
      -
      -
    • -
    • -

      2018-01-19T13:43:19-05:00 (commit #c735c27)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update file headers
      -
      -
    • -
    • -

      2016-10-13T21:55:23-04:00 (commit #b8d4768)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      camelCase methods and properties
      -
      -
    • -
    • -

      2016-10-12T22:12:25-04:00 (commit #6740aae)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      PHP7 or bust!
      -
      -
    • -
    • -

      2016-09-07T17:39:19-04:00 (commit #ca60162)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Miscellaneous cleanup and refactoring
      -
      -
    • -
    • -

      2016-09-07T14:22:52-04:00 (commit #2db7ad1)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      More style fixes
      -
      -
    • -
    • -

      2016-09-07T13:17:17-04:00 (commit #24f3b1d)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update header comments
      -
      -
    • -
    • -

      2016-09-07T13:10:03-04:00 (commit #bb38213)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Code Style fixes
      -
      -
    • -
    • -

      2015-11-10T20:59:03-05:00 (commit #2613a1c)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update lots of comments
      -
      -
    • -
    • -

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Make class names Pascal Case
      -
      -
    • -
    • -

      2015-07-29T16:51:17-04:00 (commit #8511c6a)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Move library into src folder, fix simpletest test runner
      -
      -
    • -
    • -

      2015-07-16T16:56:13-04:00 (commit #bfc3ea3)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Reorganize drivers into a more modern layout
      -
      -
    • -
    • -

      2014-08-08T13:48:20-04:00 (commit #dd672df)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Reorganize classes to autoload by namespace
      -
      -
    • -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractUtil/__construct.html b/apiDocumentation/classes/Query_Drivers_AbstractUtil/__construct.html index 27c2aed..d517883 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractUtil/__construct.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractUtil/__construct.html @@ -59,7 +59,7 @@ Parameter
  • - Source + Source
  • @@ -84,7 +84,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupData.html b/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupData.html index 27d025f..50ad0ba 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupData.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupData.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupStructure.html b/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupStructure.html index 67f9a62..0e447b8 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupStructure.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractUtil/backupStructure.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractUtil/createTable.html b/apiDocumentation/classes/Query_Drivers_AbstractUtil/createTable.html index 27a578a..6b9899c 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractUtil/createTable.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractUtil/createTable.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -110,7 +110,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractUtil/deleteTable.html b/apiDocumentation/classes/Query_Drivers_AbstractUtil/deleteTable.html index 1f10194..87a1589 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractUtil/deleteTable.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractUtil/deleteTable.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_AbstractUtil/getDriver.html b/apiDocumentation/classes/Query_Drivers_AbstractUtil/getDriver.html index ccb84e9..3747517 100644 --- a/apiDocumentation/classes/Query_Drivers_AbstractUtil/getDriver.html +++ b/apiDocumentation/classes/Query_Drivers_AbstractUtil/getDriver.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_Driver.html b/apiDocumentation/classes/Query_Drivers_Mysql_Driver.html index 9abe520..0278831 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_Driver.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_Driver.html @@ -55,14 +55,14 @@
  • Hierarchy
  • +
  • + Tasks +
  • Methods
  • - History -
  • -
  • - Source + Source
  • @@ -75,6 +75,7 @@
    class Driver extends AbstractDriver {
    +

    Tasks

    + + + + + + + + + + + +
    LineTask
    77add checks for MariaDB for future-proofing

    Methods

    +

    public

    +
      +
    • __construct() + — Connect to MySQL Database
    • +
    • returning() + — Generate the returning clause for the current database
    • +

    Inherited from Query\Drivers\AbstractDriver

    public

      @@ -177,6 +200,8 @@ — Retrieve list of data types for the database
    • getUtil() — Get the Util class for the current driver
    • +
    • getVersion() + — Get the version of the database engine
    • getViews() — Return list of views for the current database
    • insertBatch() @@ -193,6 +218,8 @@ — Surrounds the string with the databases identifier escape characters
    • quoteTable() — Quote database table name, and set prefix
    • +
    • returning() + — Generate the returning clause for the current database
    • setLastQuery() — Set the last query sql
    • setTablePrefix() @@ -263,173 +290,10 @@
    -

    History

    -
      -
    • -

      2018-01-24T13:14:03-05:00 (commit #1d583bc)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Add more type hinting
      -
      -
    • -
    • -

      2018-01-22T15:43:56-05:00 (commit #91eb812)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Various refactoring
      -
      -
    • -
    • -

      2018-01-19T15:47:34-05:00 (commit #369ca6e)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Flatten source structure a bit
      -
      -
    • -
    • -

      2018-01-19T13:43:19-05:00 (commit #c735c27)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update file headers
      -
      -
    • -
    • -

      2016-10-13T21:55:23-04:00 (commit #b8d4768)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      camelCase methods and properties
      -
      -
    • -
    • -

      2016-10-12T22:12:25-04:00 (commit #6740aae)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      PHP7 or bust!
      -
      -
    • -
    • -

      2016-09-07T17:39:19-04:00 (commit #ca60162)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Miscellaneous cleanup and refactoring
      -
      -
    • -
    • -

      2016-09-07T13:17:17-04:00 (commit #24f3b1d)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update header comments
      -
      -
    • -
    • -

      2016-09-07T13:10:03-04:00 (commit #bb38213)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Code Style fixes
      -
      -
    • -
    • -

      2015-11-11T09:25:21-05:00 (commit #e62f577)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Fix a bunch of one line if statements
      -
      -
    • -
    • -

      2015-11-10T20:59:03-05:00 (commit #2613a1c)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update lots of comments
      -
      -
    • -
    • -

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Make class names Pascal Case
      -
      -
    • -
    • -

      2015-07-30T16:40:30-04:00 (commit #225017a)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Lots of refactoring -- accessors/mutators instead of direct access, reduce query builder test database connections, and simplify some logic
      -
      -
    • -
    • -

      2015-07-29T16:51:17-04:00 (commit #8511c6a)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Move library into src folder, fix simpletest test runner
      -
      -
    • -
    • -

      2015-07-16T16:56:13-04:00 (commit #bfc3ea3)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Reorganize drivers into a more modern layout
      -
      -
    • -
    • -

      2014-04-24T16:25:04-04:00 (commit #5b531cf)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      De-duplicate truncate method of drivers
      -
      -
    • -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_Driver/__construct.html b/apiDocumentation/classes/Query_Drivers_Mysql_Driver/__construct.html index b7eb9d9..d816570 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_Driver/__construct.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_Driver/__construct.html @@ -59,7 +59,7 @@ Parameter
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_Driver/returning.html b/apiDocumentation/classes/Query_Drivers_Mysql_Driver/returning.html new file mode 100644 index 0000000..0b29567 --- /dev/null +++ b/apiDocumentation/classes/Query_Drivers_Mysql_Driver/returning.html @@ -0,0 +1,130 @@ + + + + + phpDox - Query\Drivers\Mysql\Driver::returning + + + + + +
    +
    + +
    + +
    +

    Query\Drivers\Mysql\Driver::returning

    +

    Generate the returning clause for the current database

    +

    +

      +

      Signature

      +
      + public function returning(string + $query, + string + $select ) + +
      +

      Parameters

      +
      +
      $query + — + string
      +
      +
      $select + — + string
      +
      +
      +

      Returns

      +
      +
      string
      +
      +
      +

      Parent Implementation

      + + + + + + + + + + + + +
      LineTask
      77add checks for MariaDB for future-proofing
      +
    +
    +
    + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors +
    + + diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL.html index 287cf12..9a789f4 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -107,7 +104,7 @@

    public

    • columnList() - — SQL to show infromation about columns in a table
    • + — SQL to show information about columns in a table
    • dbList() — Returns sql to list other databases
    • explain() @@ -144,173 +141,10 @@ — Limit clause
    -

    History

    -
      -
    • -

      2018-01-26T15:45:46-05:00 (commit #33bb440)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      SQLite improvements, remove nullable PDOStatement return values
      -
      -
    • -
    • -

      2018-01-24T13:14:03-05:00 (commit #1d583bc)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Add more type hinting
      -
      -
    • -
    • -

      2018-01-19T15:47:34-05:00 (commit #369ca6e)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Flatten source structure a bit
      -
      -
    • -
    • -

      2018-01-19T13:43:19-05:00 (commit #c735c27)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update file headers
      -
      -
    • -
    • -

      2016-10-13T21:55:23-04:00 (commit #b8d4768)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      camelCase methods and properties
      -
      -
    • -
    • -

      2016-10-12T22:12:25-04:00 (commit #6740aae)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      PHP7 or bust!
      -
      -
    • -
    • -

      2016-09-07T17:39:19-04:00 (commit #ca60162)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Miscellaneous cleanup and refactoring
      -
      -
    • -
    • -

      2016-09-07T13:17:17-04:00 (commit #24f3b1d)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update header comments
      -
      -
    • -
    • -

      2015-11-11T09:25:21-05:00 (commit #e62f577)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Fix a bunch of one line if statements
      -
      -
    • -
    • -

      2015-11-10T20:59:03-05:00 (commit #2613a1c)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Update lots of comments
      -
      -
    • -
    • -

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      -
      -

      - Author: Timothy J Warren (tim@timshomepage.net) / - Commiter: Timothy J Warren (tim@timshomepage.net) -

      -
      Make class names Pascal Case
      -
      -
    • -
    • -

      2015-07-29T16:51:17-04:00 (commit #8511c6a)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Move library into src folder, fix simpletest test runner
      -
      -
    • -
    • -

      2015-07-16T16:56:13-04:00 (commit #bfc3ea3)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Reorganize drivers into a more modern layout
      -
      -
    • -
    • -

      2014-04-24T15:32:09-04:00 (commit #17354ee)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Move SQL and Util classes to their own namespaces
      -
      -
    • -
    • -

      2014-04-17T16:41:12-04:00 (commit #d6c0fd2)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Add update and delete rules to foreign key methods
      -
      -
    • -
    • -

      2014-04-15T16:15:08-04:00 (commit #80595df)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Update foreign key driver methods to return the same kind of information
      -
      -
    • -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/columnList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/columnList.html index cc77ee7..8cf3c1c 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/columnList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/columnList.html @@ -65,13 +65,13 @@ Interface
  • - Source + Source
  • Query\Drivers\Mysql\SQL::columnList

    -

    SQL to show infromation about columns in a table

    +

    SQL to show information about columns in a table

      Signature

      @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/dbList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/dbList.html index 31c1405..f94a1bd 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/dbList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/dbList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/explain.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/explain.html index 7a0615c..03acb33 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/explain.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/explain.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/fkList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/fkList.html index 1da065d..e0c65d0 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/fkList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/fkList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/functionList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/functionList.html index 678d0e6..27660f6 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/functionList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/functionList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/indexList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/indexList.html index 4067e2b..644307c 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/indexList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/indexList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/limit.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/limit.html index 136cb7c..33e9c6f 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/limit.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/limit.html @@ -68,7 +68,7 @@ Overrides
  • - Source + Source
  • @@ -83,8 +83,8 @@ $sql, int $limit, - [boolean - $offset = FALSE] ) + [int + $offset = NULL] )

    Parameters

    @@ -99,7 +99,7 @@
    $offset — - boolean
    + int



    Returns

    @@ -124,7 +124,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/procedureList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/procedureList.html index d8558c5..abbb0c9 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/procedureList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/procedureList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/random.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/random.html index 3d1c0b6..be6a824 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/random.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/random.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/sequenceList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/sequenceList.html index 62c55c8..bd04547 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/sequenceList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/sequenceList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/systemTableList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/systemTableList.html index e5c42d8..3be2049 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/systemTableList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/systemTableList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/tableList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/tableList.html index 5b8edb7..ebcf2cb 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/tableList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/tableList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/triggerList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/triggerList.html index a927c78..786e3f6 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/triggerList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/triggerList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/typeList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/typeList.html index a343a20..1fad00f 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/typeList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/typeList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/viewList.html b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/viewList.html index 5780b10..10f8069 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_SQL/viewList.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_SQL/viewList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_Util.html b/apiDocumentation/classes/Query_Drivers_Mysql_Util.html index 3e3f49a..e50b4c5 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_Util.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_Util.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -118,173 +115,10 @@ — Get the driver object for the current connection -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupData.html b/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupData.html index 362e8ed..f7640f1 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupData.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupData.html @@ -65,7 +65,7 @@ Overrides
  • - Source + Source
  • @@ -103,7 +103,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupStructure.html b/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupStructure.html index 10a0e62..852d760 100644 --- a/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupStructure.html +++ b/apiDocumentation/classes/Query_Drivers_Mysql_Util/backupStructure.html @@ -62,7 +62,7 @@ Overrides
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver.html b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver.html index 3dad1b1..cbd95f4 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -103,11 +100,13 @@
  • public array getFks()
  • public array getIndexes()
  • public array getTypes() +
  • public string getVersion()
  • public array|null driverQuery()
  • public int|null numRows()
  • public array<string|array|null> insertBatch()
  • public array<string updateBatch()
  • public PDOStatement truncate() +
  • public string returning()
  • public mixed _quote()
  • -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/__construct.html b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/__construct.html index 0bdb635..47ab48e 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/__construct.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/__construct.html @@ -59,7 +59,7 @@ Parameter
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getFks.html b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getFks.html index 3ba8f3f..7b1278c 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getFks.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getFks.html @@ -68,7 +68,7 @@ Overrides
  • - Source + Source
  • @@ -112,7 +112,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getSchemas.html b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getSchemas.html index 3463c73..9bc44dc 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getSchemas.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_Driver/getSchemas.html @@ -65,7 +65,7 @@ Overrides
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL.html index ad8827e..5c6b665 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -141,173 +138,10 @@ — Limit clause -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/columnList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/columnList.html index 4455619..89926b2 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/columnList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/columnList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/dbList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/dbList.html index 6f34240..931866c 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/dbList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/dbList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/explain.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/explain.html index 2844533..71bb0dc 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/explain.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/explain.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/fkList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/fkList.html index 1349715..3fd16d3 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/fkList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/fkList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/functionList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/functionList.html index cc88648..47c8065 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/functionList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/functionList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/indexList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/indexList.html index 2c1a6f4..2c44354 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/indexList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/indexList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/procedureList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/procedureList.html index 254e460..e01a0fb 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/procedureList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/procedureList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/random.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/random.html index 2daf828..e66c320 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/random.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/random.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/sequenceList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/sequenceList.html index 817f694..530b642 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/sequenceList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/sequenceList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/systemTableList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/systemTableList.html index 5f80a1c..dabe33a 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/systemTableList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/systemTableList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/tableList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/tableList.html index f2b5283..f42093c 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/tableList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/tableList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/triggerList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/triggerList.html index e1ccae6..67a3f97 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/triggerList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/triggerList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/typeList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/typeList.html index 1fe6023..90d0d5b 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/typeList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/typeList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/viewList.html b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/viewList.html index d906876..d020f07 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/viewList.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_SQL/viewList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_Util.html b/apiDocumentation/classes/Query_Drivers_Pgsql_Util.html index e144beb..0709111 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_Util.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_Util.html @@ -62,10 +62,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -106,7 +103,7 @@ - 31 + 33 Implement Backup function @@ -134,173 +131,10 @@ — Get the driver object for the current connection -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupData.html b/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupData.html index f3e9b00..c84aac2 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupData.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupData.html @@ -65,7 +65,7 @@ Overrides
  • - Source + Source
  • @@ -103,7 +103,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupStructure.html b/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupStructure.html index 60f7478..487feb6 100644 --- a/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupStructure.html +++ b/apiDocumentation/classes/Query_Drivers_Pgsql_Util/backupStructure.html @@ -65,7 +65,7 @@ Tasks
  • - Source + Source
  • @@ -100,14 +100,14 @@ - 31 + 33 Implement Backup function
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver.html index fd6cfa1..c29a901 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -79,6 +76,7 @@
  • public array getTables()
  • public array getFks()
  • public array insertBatch() +
  • public string returning()
  • Inherited from Query\Drivers\AbstractDriver

    public

    @@ -194,6 +196,8 @@ — Retrieve list of data types for the database
  • getUtil() — Get the Util class for the current driver
  • +
  • getVersion() + — Get the version of the database engine
  • getViews() — Return list of views for the current database
  • insertBatch() @@ -210,6 +214,8 @@ — Surrounds the string with the databases identifier escape characters
  • quoteTable() — Quote database table name, and set prefix
  • +
  • returning() + — Generate the returning clause for the current database
  • setLastQuery() — Set the last query sql
  • setTablePrefix() @@ -280,173 +286,10 @@
  • -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/__construct.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/__construct.html index 870305f..d6743d0 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/__construct.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/__construct.html @@ -59,7 +59,7 @@ Parameter
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getDbs.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getDbs.html index 3611afe..7f14197 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getDbs.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getDbs.html @@ -65,7 +65,7 @@ Overrides
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getFks.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getFks.html index e18c6e3..edc688c 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getFks.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getFks.html @@ -68,7 +68,7 @@ Overrides
  • - Source + Source
  • @@ -112,7 +112,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getTables.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getTables.html index 61129fa..af751b5 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getTables.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/getTables.html @@ -65,7 +65,7 @@ Overrides
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/insertBatch.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/insertBatch.html index db5ae91..5142a55 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/insertBatch.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/insertBatch.html @@ -68,7 +68,7 @@ Overrides
  • - Source + Source
  • @@ -118,7 +118,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/returning.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/returning.html new file mode 100644 index 0000000..1511840 --- /dev/null +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Driver/returning.html @@ -0,0 +1,115 @@ + + + + + phpDox - Query\Drivers\Sqlite\Driver::returning + + + + + +
    +
    + +
    + +
    +

    Query\Drivers\Sqlite\Driver::returning

    +

    Generate the returning clause for the current database

    +

    +

      +

      Signature

      +
      + public function returning(string + $query, + string + $select ) + +
      +

      Parameters

      +
      +
      $query + — + string
      +
      +
      $select + — + string
      +
      +
      +

      Returns

      +
      +
      string
      +
      +
      +

      Parent Implementation

      + +
    +
    +
    + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors +
    + + diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL.html index 1d93461..5064962 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -141,179 +138,10 @@ — Limit clause -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/columnList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/columnList.html index 90744b7..9c8eb36 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/columnList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/columnList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/dbList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/dbList.html index c42bd45..42d2419 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/dbList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/dbList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/explain.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/explain.html index 61fbda5..4de7969 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/explain.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/explain.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/fkList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/fkList.html index c62a7cd..405df80 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/fkList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/fkList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/functionList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/functionList.html index c6bd71e..2945013 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/functionList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/functionList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/indexList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/indexList.html index 8b25208..bf5399c 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/indexList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/indexList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/procedureList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/procedureList.html index 42eaef6..3ceaba4 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/procedureList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/procedureList.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/random.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/random.html index 3d10d5c..8d688ab 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/random.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/random.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/sequenceList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/sequenceList.html index c025239..d17efa0 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/sequenceList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/sequenceList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/systemTableList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/systemTableList.html index b2c0532..c9aa04a 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/systemTableList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/systemTableList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -91,7 +91,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/tableList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/tableList.html index 60d4352..fe8e5bb 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/tableList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/tableList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/triggerList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/triggerList.html index b751c32..2d3bc00 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/triggerList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/triggerList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/typeList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/typeList.html index 8b071d6..b116bd4 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/typeList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/typeList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -91,7 +91,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/viewList.html b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/viewList.html index 6a096dd..818a439 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/viewList.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_SQL/viewList.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -90,7 +90,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Util.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Util.html index 0ca04b1..a60cf7f 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Util.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Util.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -118,173 +115,10 @@ — Get the driver object for the current connection -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupData.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupData.html index 5bcb415..b838c08 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupData.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupData.html @@ -65,7 +65,7 @@ Overrides
  • - Source + Source
  • @@ -103,7 +103,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupStructure.html b/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupStructure.html index caccf6c..7f28862 100644 --- a/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupStructure.html +++ b/apiDocumentation/classes/Query_Drivers_Sqlite_Util/backupStructure.html @@ -62,7 +62,7 @@ Overrides
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Exception_BadDBDriverException.html b/apiDocumentation/classes/Query_Exception_BadDBDriverException.html index 38c31dd..e41b60c 100644 --- a/apiDocumentation/classes/Query_Exception_BadDBDriverException.html +++ b/apiDocumentation/classes/Query_Exception_BadDBDriverException.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -190,143 +187,10 @@ — Gets the stack trace as a string -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Exception_NonExistentConnectionException.html b/apiDocumentation/classes/Query_Exception_NonExistentConnectionException.html index acccc0f..93523c9 100644 --- a/apiDocumentation/classes/Query_Exception_NonExistentConnectionException.html +++ b/apiDocumentation/classes/Query_Exception_NonExistentConnectionException.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -190,143 +187,10 @@ — Gets the stack trace as a string -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_Exception_NotImplementedException.html b/apiDocumentation/classes/Query_Exception_NotImplementedException.html index 93ee384..1e0c584 100644 --- a/apiDocumentation/classes/Query_Exception_NotImplementedException.html +++ b/apiDocumentation/classes/Query_Exception_NotImplementedException.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -226,143 +223,10 @@ — Gets the stack trace as a string -

    History

    -
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_MapType.html b/apiDocumentation/classes/Query_MapType.html new file mode 100644 index 0000000..c2e9ded --- /dev/null +++ b/apiDocumentation/classes/Query_MapType.html @@ -0,0 +1,114 @@ + + + + + phpDox - Query\MapType + + + + + +
    +
    + +
    + +
    +

    Query\MapType

    +

    'Enum' of query map types

    +

    +

      +

      Synopsis

      +
      class MapType + {
      • // constants
      • const GROUP_END = 'group_end';
      • const GROUP_START = 'group_start';
      • const JOIN = 'join';
      • const LIKE = 'like';
      • const WHERE = 'where';
      • const WHERE_IN = 'where_in';
      + + }
      +

      Constants

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      NameValue
      GROUP_END'group_end'
      GROUP_START'group_start'
      JOIN'join'
      LIKE'like'
      WHERE'where'
      WHERE_IN'where_in'
      +
    +
    +
    + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors +
    + + diff --git a/apiDocumentation/classes/Query_QueryBuilder.html b/apiDocumentation/classes/Query_QueryBuilder.html index c4764d5..3d2a331 100644 --- a/apiDocumentation/classes/Query_QueryBuilder.html +++ b/apiDocumentation/classes/Query_QueryBuilder.html @@ -55,9 +55,6 @@
  • Hierarchy
  • -
  • - Tasks -
  • Members
  • @@ -65,10 +62,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -79,52 +73,48 @@ @@ -101,7 +101,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_QueryBuilder/countAllResults.html b/apiDocumentation/classes/Query_QueryBuilder/countAllResults.html index 44d9d23..d70d670 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/countAllResults.html +++ b/apiDocumentation/classes/Query_QueryBuilder/countAllResults.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -107,7 +107,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_QueryBuilder/delete.html b/apiDocumentation/classes/Query_QueryBuilder/delete.html index f1fc19f..779bd3b 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/delete.html +++ b/apiDocumentation/classes/Query_QueryBuilder/delete.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -108,7 +108,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_QueryBuilder/distinct.html b/apiDocumentation/classes/Query_QueryBuilder/distinct.html index 77f820b..49a03f7 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/distinct.html +++ b/apiDocumentation/classes/Query_QueryBuilder/distinct.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -78,7 +78,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -91,7 +91,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_QueryBuilder/explain.html b/apiDocumentation/classes/Query_QueryBuilder/explain.html index ae18364..09233d3 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/explain.html +++ b/apiDocumentation/classes/Query_QueryBuilder/explain.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -78,7 +78,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -91,7 +91,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_QueryBuilder/from.html b/apiDocumentation/classes/Query_QueryBuilder/from.html index 2362ac4..ba1b8bc 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/from.html +++ b/apiDocumentation/classes/Query_QueryBuilder/from.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -89,7 +89,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -102,7 +102,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/classes/Query_QueryBuilder/get.html b/apiDocumentation/classes/Query_QueryBuilder/get.html index c3d6faa..cfaed66 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/get.html +++ b/apiDocumentation/classes/Query_QueryBuilder/get.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -78,10 +78,10 @@
    public function get([string $table = '', - [boolean - $limit = FALSE, - [boolean - $offset = FALSE]]] ) + [int + $limit = NULL, + [int + $offset = NULL]]] )

    Parameters

    @@ -92,11 +92,11 @@
    $limit — - boolean
    + int



    $offset — - boolean
    + int



    Returns

    @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/getCompiledDelete.html b/apiDocumentation/classes/Query_QueryBuilder/getCompiledDelete.html index 4160bc7..190a0b4 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/getCompiledDelete.html +++ b/apiDocumentation/classes/Query_QueryBuilder/getCompiledDelete.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -107,7 +107,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/getCompiledInsert.html b/apiDocumentation/classes/Query_QueryBuilder/getCompiledInsert.html index a5ff33e..bd8ed52 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/getCompiledInsert.html +++ b/apiDocumentation/classes/Query_QueryBuilder/getCompiledInsert.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -107,7 +107,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/getCompiledSelect.html b/apiDocumentation/classes/Query_QueryBuilder/getCompiledSelect.html index 5124b2d..b83481a 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/getCompiledSelect.html +++ b/apiDocumentation/classes/Query_QueryBuilder/getCompiledSelect.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -107,7 +107,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/getCompiledUpdate.html b/apiDocumentation/classes/Query_QueryBuilder/getCompiledUpdate.html index 9bdabf5..08b6d95 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/getCompiledUpdate.html +++ b/apiDocumentation/classes/Query_QueryBuilder/getCompiledUpdate.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -107,7 +107,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/getWhere.html b/apiDocumentation/classes/Query_QueryBuilder/getWhere.html index 8da73ec..2299e9c 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/getWhere.html +++ b/apiDocumentation/classes/Query_QueryBuilder/getWhere.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -80,10 +80,10 @@ $table, [array $where = , - [boolean - $limit = FALSE, - [boolean - $offset = FALSE]]] ) + [int + $limit = NULL, + [int + $offset = NULL]]] )

    Parameters

    @@ -98,11 +98,11 @@
    $limit — - boolean
    + int



    $offset — - boolean
    + int



    Returns

    @@ -120,7 +120,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/groupBy.html b/apiDocumentation/classes/Query_QueryBuilder/groupBy.html index 157ed83..1a7b43f 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/groupBy.html +++ b/apiDocumentation/classes/Query_QueryBuilder/groupBy.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -89,7 +89,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -102,7 +102,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/groupEnd.html b/apiDocumentation/classes/Query_QueryBuilder/groupEnd.html index b44849e..ca55e83 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/groupEnd.html +++ b/apiDocumentation/classes/Query_QueryBuilder/groupEnd.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -78,7 +78,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/groupStart.html b/apiDocumentation/classes/Query_QueryBuilder/groupStart.html index 0922597..4ac7162 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/groupStart.html +++ b/apiDocumentation/classes/Query_QueryBuilder/groupStart.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -78,7 +78,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/having.html b/apiDocumentation/classes/Query_QueryBuilder/having.html index 0cc83a0..bc93e4b 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/having.html +++ b/apiDocumentation/classes/Query_QueryBuilder/having.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/insert.html b/apiDocumentation/classes/Query_QueryBuilder/insert.html index 9906a26..3e613b4 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/insert.html +++ b/apiDocumentation/classes/Query_QueryBuilder/insert.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/insertBatch.html b/apiDocumentation/classes/Query_QueryBuilder/insertBatch.html index 536b57d..e8e8542 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/insertBatch.html +++ b/apiDocumentation/classes/Query_QueryBuilder/insertBatch.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/join.html b/apiDocumentation/classes/Query_QueryBuilder/join.html index 28507ec..0b2611f 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/join.html +++ b/apiDocumentation/classes/Query_QueryBuilder/join.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/like.html b/apiDocumentation/classes/Query_QueryBuilder/like.html index 3376a27..392014d 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/like.html +++ b/apiDocumentation/classes/Query_QueryBuilder/like.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/limit.html b/apiDocumentation/classes/Query_QueryBuilder/limit.html index 39d3c2d..37225bc 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/limit.html +++ b/apiDocumentation/classes/Query_QueryBuilder/limit.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -78,8 +78,8 @@
    public function limit(int $limit, - [boolean - $offset = FALSE] ) + [int + $offset = NULL] )

    Parameters

    @@ -90,12 +90,12 @@
    $offset — - boolean
    + int



    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/notGroupStart.html b/apiDocumentation/classes/Query_QueryBuilder/notGroupStart.html index 29dcd3c..3c2ccdf 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/notGroupStart.html +++ b/apiDocumentation/classes/Query_QueryBuilder/notGroupStart.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -78,7 +78,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/notLike.html b/apiDocumentation/classes/Query_QueryBuilder/notLike.html index 712a7ca..c0c7185 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/notLike.html +++ b/apiDocumentation/classes/Query_QueryBuilder/notLike.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orGroupStart.html b/apiDocumentation/classes/Query_QueryBuilder/orGroupStart.html index 643270c..13253cc 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orGroupStart.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orGroupStart.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -78,7 +78,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orHaving.html b/apiDocumentation/classes/Query_QueryBuilder/orHaving.html index f6e732b..0b732b5 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orHaving.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orHaving.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orLike.html b/apiDocumentation/classes/Query_QueryBuilder/orLike.html index 78db4a5..e98f265 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orLike.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orLike.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orNotGroupStart.html b/apiDocumentation/classes/Query_QueryBuilder/orNotGroupStart.html index c1cc119..2b8c078 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orNotGroupStart.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orNotGroupStart.html @@ -62,7 +62,7 @@ Interface
  • - Source + Source
  • @@ -78,7 +78,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -91,7 +91,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orNotLike.html b/apiDocumentation/classes/Query_QueryBuilder/orNotLike.html index 6694223..0595a1b 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orNotLike.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orNotLike.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orWhere.html b/apiDocumentation/classes/Query_QueryBuilder/orWhere.html index 91dfe1f..fd444fe 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orWhere.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orWhere.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orWhereIn.html b/apiDocumentation/classes/Query_QueryBuilder/orWhereIn.html index 4b28886..0a16246 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orWhereIn.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orWhereIn.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orWhereNotIn.html b/apiDocumentation/classes/Query_QueryBuilder/orWhereNotIn.html index 010503a..56023e5 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orWhereNotIn.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orWhereNotIn.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/orderBy.html b/apiDocumentation/classes/Query_QueryBuilder/orderBy.html index b3c328f..aeee196 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/orderBy.html +++ b/apiDocumentation/classes/Query_QueryBuilder/orderBy.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/returning.html b/apiDocumentation/classes/Query_QueryBuilder/returning.html index 43c3bb7..22745d3 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/returning.html +++ b/apiDocumentation/classes/Query_QueryBuilder/returning.html @@ -62,22 +62,19 @@ Return
  • - Tasks -
  • -
  • - Source + Source
  • Query\QueryBuilder::returning

    -

    +

    Add a 'returning' clause to an insert,update, or delete query

    diff --git a/apiDocumentation/classes/Query_QueryBuilder/select.html b/apiDocumentation/classes/Query_QueryBuilder/select.html index 9583b3a..31ea5c0 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/select.html +++ b/apiDocumentation/classes/Query_QueryBuilder/select.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -89,7 +89,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -102,7 +102,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/selectAvg.html b/apiDocumentation/classes/Query_QueryBuilder/selectAvg.html index a15f05d..3d5c653 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/selectAvg.html +++ b/apiDocumentation/classes/Query_QueryBuilder/selectAvg.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/selectMax.html b/apiDocumentation/classes/Query_QueryBuilder/selectMax.html index c7d0e3c..49a92f0 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/selectMax.html +++ b/apiDocumentation/classes/Query_QueryBuilder/selectMax.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/selectMin.html b/apiDocumentation/classes/Query_QueryBuilder/selectMin.html index 1734c5c..d8a4a34 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/selectMin.html +++ b/apiDocumentation/classes/Query_QueryBuilder/selectMin.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/selectSum.html b/apiDocumentation/classes/Query_QueryBuilder/selectSum.html index a3fdf10..9bb3a60 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/selectSum.html +++ b/apiDocumentation/classes/Query_QueryBuilder/selectSum.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/set.html b/apiDocumentation/classes/Query_QueryBuilder/set.html index 525a165..8181664 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/set.html +++ b/apiDocumentation/classes/Query_QueryBuilder/set.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/update.html b/apiDocumentation/classes/Query_QueryBuilder/update.html index 535dbcc..7081b25 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/update.html +++ b/apiDocumentation/classes/Query_QueryBuilder/update.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/updateBatch.html b/apiDocumentation/classes/Query_QueryBuilder/updateBatch.html index 453a823..7555806 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/updateBatch.html +++ b/apiDocumentation/classes/Query_QueryBuilder/updateBatch.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/where.html b/apiDocumentation/classes/Query_QueryBuilder/where.html index 05453ae..b616214 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/where.html +++ b/apiDocumentation/classes/Query_QueryBuilder/where.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -101,7 +101,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -114,7 +114,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/whereIn.html b/apiDocumentation/classes/Query_QueryBuilder/whereIn.html index 658722d..246efa0 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/whereIn.html +++ b/apiDocumentation/classes/Query_QueryBuilder/whereIn.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilder/whereNotIn.html b/apiDocumentation/classes/Query_QueryBuilder/whereNotIn.html index 1dabfbc..3660a32 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/whereNotIn.html +++ b/apiDocumentation/classes/Query_QueryBuilder/whereNotIn.html @@ -65,7 +65,7 @@ Interface
  • - Source + Source
  • @@ -95,7 +95,7 @@

    Returns

    -
    QueryBuilderInterface
    +
    QueryBuilder

    @@ -108,7 +108,7 @@ diff --git a/apiDocumentation/classes/Query_QueryBuilderBase.html b/apiDocumentation/classes/Query_QueryBuilderBase.html new file mode 100644 index 0000000..312be63 --- /dev/null +++ b/apiDocumentation/classes/Query_QueryBuilderBase.html @@ -0,0 +1,116 @@ + + + + + phpDox - Query\QueryBuilderBase + + + + + +
    +
    + +
    + +
    +

    Query\QueryBuilderBase

    +

    +

    +

      +

      Synopsis

      +
      class QueryBuilderBase + {
      + + }
      +

      Members

      +
      +

      public

      +
        +
      • $connName + — + string
        Convenience property for connection management
      • +
      • $queries + — + array
        List of queries executed
      • +
      +
      +

      Methods

      +
      +

      public

      + +
      +

    +
    + + + diff --git a/apiDocumentation/classes/Query_QueryBuilder/__call.html b/apiDocumentation/classes/Query_QueryBuilderBase/__call.html similarity index 89% rename from apiDocumentation/classes/Query_QueryBuilder/__call.html rename to apiDocumentation/classes/Query_QueryBuilderBase/__call.html index 3958708..6bdf54e 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/__call.html +++ b/apiDocumentation/classes/Query_QueryBuilderBase/__call.html @@ -2,7 +2,7 @@ - phpDox - Query\QueryBuilder::__call + phpDox - Query\QueryBuilderBase::__call @@ -42,7 +42,7 @@ Query
  • - QueryBuilder + QueryBuilderBase
  • __call
  • @@ -65,12 +65,12 @@ Throws
  • - Source + Source
  • -

    Query\QueryBuilder::__call

    +

    Query\QueryBuilderBase::__call

    Calls a function further down the inheritance chain.

    'Implements' methods on the driver object

    diff --git a/apiDocumentation/classes/Query_QueryBuilder/__construct.html b/apiDocumentation/classes/Query_QueryBuilderBase/__construct.html similarity index 88% rename from apiDocumentation/classes/Query_QueryBuilder/__construct.html rename to apiDocumentation/classes/Query_QueryBuilderBase/__construct.html index fedf99b..4119c72 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/__construct.html +++ b/apiDocumentation/classes/Query_QueryBuilderBase/__construct.html @@ -2,7 +2,7 @@ - phpDox - Query\QueryBuilder::__construct + phpDox - Query\QueryBuilderBase::__construct @@ -42,7 +42,7 @@ Query
  • - QueryBuilder + QueryBuilderBase
  • __construct
  • @@ -59,12 +59,12 @@ Parameter
  • - Source + Source
  • -

    Query\QueryBuilder::__construct

    +

    Query\QueryBuilderBase::__construct

    Constructor

    diff --git a/apiDocumentation/classes/Query_QueryBuilder/__destruct.html b/apiDocumentation/classes/Query_QueryBuilderBase/__destruct.html similarity index 84% rename from apiDocumentation/classes/Query_QueryBuilder/__destruct.html rename to apiDocumentation/classes/Query_QueryBuilderBase/__destruct.html index daa16fc..ff645b2 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/__destruct.html +++ b/apiDocumentation/classes/Query_QueryBuilderBase/__destruct.html @@ -2,7 +2,7 @@ - phpDox - Query\QueryBuilder::__destruct + phpDox - Query\QueryBuilderBase::__destruct @@ -42,7 +42,7 @@ Query
  • - QueryBuilder + QueryBuilderBase
  • __destruct
  • @@ -56,12 +56,12 @@ Synopsis
  • - Source + Source
  • -

    Query\QueryBuilder::__destruct

    +

    Query\QueryBuilderBase::__destruct

    Destructor

    diff --git a/apiDocumentation/classes/Query_QueryBuilder/resetQuery.html b/apiDocumentation/classes/Query_QueryBuilderBase/resetQuery.html similarity index 76% rename from apiDocumentation/classes/Query_QueryBuilder/resetQuery.html rename to apiDocumentation/classes/Query_QueryBuilderBase/resetQuery.html index ec49f58..4116272 100644 --- a/apiDocumentation/classes/Query_QueryBuilder/resetQuery.html +++ b/apiDocumentation/classes/Query_QueryBuilderBase/resetQuery.html @@ -2,7 +2,7 @@ - phpDox - Query\QueryBuilder::resetQuery + phpDox - Query\QueryBuilderBase::resetQuery @@ -42,7 +42,7 @@ Query
  • - QueryBuilder + QueryBuilderBase
  • resetQuery
  • @@ -59,15 +59,12 @@ Return
  • - Interface -
  • -
  • - Source + Source
  • -

    Query\QueryBuilder::resetQuery

    +

    Query\QueryBuilderBase::resetQuery

    Clear out the class variables, so the next query can be run

    diff --git a/apiDocumentation/classes/Query_QueryParser.html b/apiDocumentation/classes/Query_QueryParser.html index 9249c36..8b594a2 100644 --- a/apiDocumentation/classes/Query_QueryParser.html +++ b/apiDocumentation/classes/Query_QueryParser.html @@ -59,10 +59,7 @@ Methods
  • - History -
  • -
  • - Source + Source
  • @@ -102,173 +99,10 @@ — Parser method for setting the parse string -

    History

    - diff --git a/apiDocumentation/classes/Query_QueryParser/__construct.html b/apiDocumentation/classes/Query_QueryParser/__construct.html index 2723a67..bf63ce4 100644 --- a/apiDocumentation/classes/Query_QueryParser/__construct.html +++ b/apiDocumentation/classes/Query_QueryParser/__construct.html @@ -59,7 +59,7 @@ Parameter
  • - Source + Source
  • @@ -84,7 +84,7 @@ diff --git a/apiDocumentation/classes/Query_QueryParser/compileJoin.html b/apiDocumentation/classes/Query_QueryParser/compileJoin.html index ede7a9d..29d66ce 100644 --- a/apiDocumentation/classes/Query_QueryParser/compileJoin.html +++ b/apiDocumentation/classes/Query_QueryParser/compileJoin.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@ diff --git a/apiDocumentation/classes/Query_QueryParser/parseJoin.html b/apiDocumentation/classes/Query_QueryParser/parseJoin.html index 7e6b2fc..3e7715e 100644 --- a/apiDocumentation/classes/Query_QueryParser/parseJoin.html +++ b/apiDocumentation/classes/Query_QueryParser/parseJoin.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@ diff --git a/apiDocumentation/classes/Query_QueryType.html b/apiDocumentation/classes/Query_QueryType.html new file mode 100644 index 0000000..34c704c --- /dev/null +++ b/apiDocumentation/classes/Query_QueryType.html @@ -0,0 +1,114 @@ + + + + + phpDox - Query\QueryType + + + + + +
    +
    + +
    + +
    +

    Query\QueryType

    +

    'Enum' of query types

    +

    +

    +
    + + + diff --git a/apiDocumentation/classes/Query_State.html b/apiDocumentation/classes/Query_State.html index ce7663f..066bddf 100644 --- a/apiDocumentation/classes/Query_State.html +++ b/apiDocumentation/classes/Query_State.html @@ -52,14 +52,14 @@
  • Synopsis
  • +
  • + Violations +
  • Methods
  • - History -
  • -
  • - Source + Source
  • @@ -70,44 +70,47 @@
    -

    Query\State::setGroupString

    +

    Query\State::__call

    -

    diff --git a/apiDocumentation/classes/Query_State/appendGroupArray.html b/apiDocumentation/classes/Query_State/appendGroupArray.html index a9fc8c3..c58dd81 100644 --- a/apiDocumentation/classes/Query_State/appendGroupArray.html +++ b/apiDocumentation/classes/Query_State/appendGroupArray.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/classes/Query_State/appendHavingMap.html b/apiDocumentation/classes/Query_State/appendHavingMap.html index d9bb7bb..44bf01b 100644 --- a/apiDocumentation/classes/Query_State/appendHavingMap.html +++ b/apiDocumentation/classes/Query_State/appendHavingMap.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/classes/Query_State/appendMap.html b/apiDocumentation/classes/Query_State/appendMap.html index a4e6645..f3c15b6 100644 --- a/apiDocumentation/classes/Query_State/appendMap.html +++ b/apiDocumentation/classes/Query_State/appendMap.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/classes/Query_State/appendSelectString.html b/apiDocumentation/classes/Query_State/appendSelectString.html index 730793b..edf6e7a 100644 --- a/apiDocumentation/classes/Query_State/appendSelectString.html +++ b/apiDocumentation/classes/Query_State/appendSelectString.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/classes/Query_State/appendSetArrayKeys.html b/apiDocumentation/classes/Query_State/appendSetArrayKeys.html index c5d6d58..824a706 100644 --- a/apiDocumentation/classes/Query_State/appendSetArrayKeys.html +++ b/apiDocumentation/classes/Query_State/appendSetArrayKeys.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/classes/Query_State/appendValues.html b/apiDocumentation/classes/Query_State/appendValues.html index d8a99c2..0217a2a 100644 --- a/apiDocumentation/classes/Query_State/appendValues.html +++ b/apiDocumentation/classes/Query_State/appendValues.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/classes/Query_State/appendWhereValues.html b/apiDocumentation/classes/Query_State/appendWhereValues.html index 0a26cc8..b44c864 100644 --- a/apiDocumentation/classes/Query_State/appendWhereValues.html +++ b/apiDocumentation/classes/Query_State/appendWhereValues.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/classes/Query_State/getFromString.html b/apiDocumentation/classes/Query_State/getFromString.html deleted file mode 100644 index 7f1c393..0000000 --- a/apiDocumentation/classes/Query_State/getFromString.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getFromString - - - - - -
    -
    - -
    - -
    -

    Query\State::getFromString

    -

    -

    -

      -

      Signature

      -
      - public function getFromString() - -
      -

      Returns

      -
      -
      string
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getGroupArray.html b/apiDocumentation/classes/Query_State/getGroupArray.html deleted file mode 100644 index be8f360..0000000 --- a/apiDocumentation/classes/Query_State/getGroupArray.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getGroupArray - - - - - -
    -
    - -
    - -
    -

    Query\State::getGroupArray

    -

    -

    -

      -

      Signature

      -
      - public function getGroupArray() - -
      -

      Returns

      -
      -
      array
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getGroupString.html b/apiDocumentation/classes/Query_State/getGroupString.html deleted file mode 100644 index cae3085..0000000 --- a/apiDocumentation/classes/Query_State/getGroupString.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getGroupString - - - - - -
    -
    - -
    - -
    -

    Query\State::getGroupString

    -

    -

    -

      -

      Signature

      -
      - public function getGroupString() - -
      -

      Returns

      -
      -
      string
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getHavingMap.html b/apiDocumentation/classes/Query_State/getHavingMap.html deleted file mode 100644 index a214315..0000000 --- a/apiDocumentation/classes/Query_State/getHavingMap.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getHavingMap - - - - - -
    -
    - -
    - -
    -

    Query\State::getHavingMap

    -

    -

    -

      -

      Signature

      -
      - public function getHavingMap() - -
      -

      Returns

      -
      -
      array
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getLimit.html b/apiDocumentation/classes/Query_State/getLimit.html deleted file mode 100644 index 0baa36b..0000000 --- a/apiDocumentation/classes/Query_State/getLimit.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getLimit - - - - - -
    -
    - -
    - -
    -

    Query\State::getLimit

    -

    -

    -

      -

      Signature

      -
      - public function getLimit() - -
      -

      Returns

      -
      -
      int
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getOffset.html b/apiDocumentation/classes/Query_State/getOffset.html deleted file mode 100644 index 3232221..0000000 --- a/apiDocumentation/classes/Query_State/getOffset.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - phpDox - Query\State::getOffset - - - - - -
    -
    - -
    - -
    -

    Query\State::getOffset

    -

    -

    -

      -

      Signature

      -
      - public function getOffset() - -
      -

      Returns

      -
      -
      string|false
      -

      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getOrderArray.html b/apiDocumentation/classes/Query_State/getOrderArray.html deleted file mode 100644 index 0b05d36..0000000 --- a/apiDocumentation/classes/Query_State/getOrderArray.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getOrderArray - - - - - -
    -
    - -
    - -
    -

    Query\State::getOrderArray

    -

    -

    -

      -

      Signature

      -
      - public function getOrderArray() - -
      -

      Returns

      -
      -
      array
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getQueryMap.html b/apiDocumentation/classes/Query_State/getQueryMap.html deleted file mode 100644 index b45c842..0000000 --- a/apiDocumentation/classes/Query_State/getQueryMap.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getQueryMap - - - - - -
    -
    - -
    - -
    -

    Query\State::getQueryMap

    -

    -

    -

      -

      Signature

      -
      - public function getQueryMap() - -
      -

      Returns

      -
      -
      array
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getSelectString.html b/apiDocumentation/classes/Query_State/getSelectString.html deleted file mode 100644 index e453c0a..0000000 --- a/apiDocumentation/classes/Query_State/getSelectString.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getSelectString - - - - - -
    -
    - -
    - -
    -

    Query\State::getSelectString

    -

    -

    -

      -

      Signature

      -
      - public function getSelectString() - -
      -

      Returns

      -
      -
      string
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getSetArrayKeys.html b/apiDocumentation/classes/Query_State/getSetArrayKeys.html deleted file mode 100644 index 8462a99..0000000 --- a/apiDocumentation/classes/Query_State/getSetArrayKeys.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getSetArrayKeys - - - - - -
    -
    - -
    - -
    -

    Query\State::getSetArrayKeys

    -

    -

    -

      -

      Signature

      -
      - public function getSetArrayKeys() - -
      -

      Returns

      -
      -
      array
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getSetString.html b/apiDocumentation/classes/Query_State/getSetString.html deleted file mode 100644 index 7b8a183..0000000 --- a/apiDocumentation/classes/Query_State/getSetString.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getSetString - - - - - -
    -
    - -
    - -
    -

    Query\State::getSetString

    -

    -

    -

      -

      Signature

      -
      - public function getSetString() - -
      -

      Returns

      -
      -
      string
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getValues.html b/apiDocumentation/classes/Query_State/getValues.html deleted file mode 100644 index 4beb73d..0000000 --- a/apiDocumentation/classes/Query_State/getValues.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getValues - - - - - -
    -
    - -
    - -
    -

    Query\State::getValues

    -

    -

    -

      -

      Signature

      -
      - public function getValues() - -
      -

      Returns

      -
      -
      array
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/getWhereValues.html b/apiDocumentation/classes/Query_State/getWhereValues.html deleted file mode 100644 index 2803f72..0000000 --- a/apiDocumentation/classes/Query_State/getWhereValues.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - phpDox - Query\State::getWhereValues - - - - - -
    -
    - -
    - -
    -

    Query\State::getWhereValues

    -

    -

    -

      -

      Signature

      -
      - public function getWhereValues() - -
      -

      Returns

      -
      -
      array
      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/setGroupArray.html b/apiDocumentation/classes/Query_State/setGroupArray.html deleted file mode 100644 index aaf88f0..0000000 --- a/apiDocumentation/classes/Query_State/setGroupArray.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - phpDox - Query\State::setGroupArray - - - - - -
    -
    - -
    - -
    -

    Query\State::setGroupArray

    -

    -

    -

      -

      Signature

      -
      - public function setGroupArray(array - $groupArray ) - -
      -

      Parameters

      -
      -
      $groupArray - — - array
      -
      -
      -

      Returns

      -
      -
      State
      -

      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/setLimit.html b/apiDocumentation/classes/Query_State/setLimit.html deleted file mode 100644 index bfea26f..0000000 --- a/apiDocumentation/classes/Query_State/setLimit.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - phpDox - Query\State::setLimit - - - - - -
    -
    - -
    - -
    -

    Query\State::setLimit

    -

    -

    -

      -

      Signature

      -
      - public function setLimit(int - $limit ) - -
      -

      Parameters

      -
      -
      $limit - — - int
      -
      -
      -

      Returns

      -
      -
      State
      -

      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/setOffset.html b/apiDocumentation/classes/Query_State/setOffset.html deleted file mode 100644 index 660be63..0000000 --- a/apiDocumentation/classes/Query_State/setOffset.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - phpDox - Query\State::setOffset - - - - - -
    -
    - -
    - -
    -

    Query\State::setOffset

    -

    -

    -

      -

      Signature

      -
      - public function setOffset(string|false - $offset ) - -
      -

      Parameters

      -
      -
      $offset - — - object
      -



      -
      -

      Returns

      -
      -
      State
      -

      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/setOrderArray.html b/apiDocumentation/classes/Query_State/setOrderArray.html index 52252e3..2e92b4c 100644 --- a/apiDocumentation/classes/Query_State/setOrderArray.html +++ b/apiDocumentation/classes/Query_State/setOrderArray.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/classes/Query_State/setSelectString.html b/apiDocumentation/classes/Query_State/setSelectString.html deleted file mode 100644 index 34ce7cb..0000000 --- a/apiDocumentation/classes/Query_State/setSelectString.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - phpDox - Query\State::setSelectString - - - - - -
    -
    - -
    - -
    -

    Query\State::setSelectString

    -

    -

    -

      -

      Signature

      -
      - public function setSelectString(string - $str ) - -
      -

      Parameters

      -
      -
      $str - — - string
      -
      -
      -

      Returns

      -
      -
      State
      -

      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/setSetArrayKeys.html b/apiDocumentation/classes/Query_State/setSetArrayKeys.html deleted file mode 100644 index b75f3d7..0000000 --- a/apiDocumentation/classes/Query_State/setSetArrayKeys.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - phpDox - Query\State::setSetArrayKeys - - - - - -
    -
    - -
    - -
    -

    Query\State::setSetArrayKeys

    -

    -

    -

      -

      Signature

      -
      - public function setSetArrayKeys(array - $setArrayKeys ) - -
      -

      Parameters

      -
      -
      $setArrayKeys - — - array
      -
      -
      -

      Returns

      -
      -
      State
      -

      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/classes/Query_State/setSetString.html b/apiDocumentation/classes/Query_State/setSetString.html deleted file mode 100644 index 013fa1b..0000000 --- a/apiDocumentation/classes/Query_State/setSetString.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - phpDox - Query\State::setSetString - - - - - -
    -
    - -
    - -
    -

    Query\State::setSetString

    -

    -

    -

      -

      Signature

      -
      - public function setSetString(string - $setString ) - -
      -

      Parameters

      -
      -
      $setString - — - string
      -
      -
      -

      Returns

      -
      -
      State
      -

      -
      -
      -

    -
    - - - diff --git a/apiDocumentation/interfaces.html b/apiDocumentation/interfaces.html index 1fd0660..df2df43 100644 --- a/apiDocumentation/interfaces.html +++ b/apiDocumentation/interfaces.html @@ -76,7 +76,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface.html index 42a830a..4c55f79 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface.html @@ -59,7 +59,7 @@ Methods
  • - Source + Source
  • @@ -97,6 +97,7 @@
  • public PDOStatement truncate()
  • public SQLInterface getSql()
  • public AbstractUtil getUtil() +
  • public string getVersion()
  • public string getLastQuery()
  • public void setLastQuery()
  • public void setTablePrefix() @@ -143,6 +144,8 @@ — Retrieve list of data types for the database
  • getUtil() — Get the Util class for the current driver
  • +
  • getVersion() + — Get the version of the database engine
  • getViews() — Return list of views for the current database
  • insertBatch() @@ -172,7 +175,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/__construct.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/__construct.html index f662b0c..45f9bce 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/__construct.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/__construct.html @@ -59,7 +59,7 @@ Parameter
  • - Source + Source
  • @@ -102,7 +102,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/affectedRows.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/affectedRows.html index 6fad3e8..d4a7439 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/affectedRows.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/affectedRows.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/driverQuery.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/driverQuery.html index 9a145ec..fdad7ae 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/driverQuery.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/driverQuery.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getColumns.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getColumns.html index a95cd13..75e9f1b 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getColumns.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getColumns.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getDbs.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getDbs.html index 0c2e0b8..62d16c1 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getDbs.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getDbs.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFks.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFks.html index 85c7d42..b17024b 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFks.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFks.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFunctions.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFunctions.html index ad3784e..0d1b988 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFunctions.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getFunctions.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getIndexes.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getIndexes.html index 9ec3652..676784d 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getIndexes.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getIndexes.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getLastQuery.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getLastQuery.html index 8d0e857..6113c55 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getLastQuery.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getLastQuery.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getProcedures.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getProcedures.html index ee97a02..0a592f8 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getProcedures.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getProcedures.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSchemas.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSchemas.html index 41bb657..e0c2f8f 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSchemas.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSchemas.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSequences.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSequences.html index ea0a3ef..dabff12 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSequences.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSequences.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSql.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSql.html index ae306ce..17b190f 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSql.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSql.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSystemTables.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSystemTables.html index 433c558..88d60e4 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSystemTables.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getSystemTables.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTables.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTables.html index 78782b1..bd6bdc7 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTables.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTables.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTriggers.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTriggers.html index efa87d6..75d7da1 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTriggers.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTriggers.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTypes.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTypes.html index 90bf767..ab6d5b7 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTypes.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getTypes.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getUtil.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getUtil.html index d94972f..c4f1df2 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getUtil.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getUtil.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/classes/Query_State/getOrderString.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getVersion.html similarity index 76% rename from apiDocumentation/classes/Query_State/getOrderString.html rename to apiDocumentation/interfaces/Query_Drivers_DriverInterface/getVersion.html index 89c4adc..16a48b3 100644 --- a/apiDocumentation/classes/Query_State/getOrderString.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getVersion.html @@ -2,7 +2,7 @@ - phpDox - Query\State::getOrderString + phpDox - Query\Drivers\DriverInterface::getVersion @@ -39,12 +39,12 @@ Classes
  • - Query + Query\Drivers
  • - State + DriverInterface
  • -
  • getOrderString
  • +
  • getVersion
  • -

    Query\State::getOrderString

    -

    +

    Query\Drivers\DriverInterface::getVersion

    +

    Get the version of the database engine

    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getViews.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getViews.html index 78ea3a9..723b746 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getViews.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/getViews.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/insertBatch.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/insertBatch.html index aa1b942..85c73cc 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/insertBatch.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/insertBatch.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/numRows.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/numRows.html index 115b742..8669ee7 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/numRows.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/numRows.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prefixTable.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prefixTable.html index 54b1bc3..2573de4 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prefixTable.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prefixTable.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareExecute.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareExecute.html index eac2f23..cb4e2a7 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareExecute.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareExecute.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareQuery.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareQuery.html index 364b27e..67947a4 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareQuery.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/prepareQuery.html @@ -65,7 +65,7 @@ Throws
  • - Source + Source
  • @@ -111,7 +111,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteIdent.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteIdent.html index b23c19f..f037e96 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteIdent.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteIdent.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteTable.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteTable.html index 7bb0bb3..8ee00fd 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteTable.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/quoteTable.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setLastQuery.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setLastQuery.html index 973a97f..85a2cb3 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setLastQuery.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setLastQuery.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setTablePrefix.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setTablePrefix.html index 6ff8e6b..090c0d5 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setTablePrefix.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/setTablePrefix.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/truncate.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/truncate.html index 40d89d7..646aa8a 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/truncate.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/truncate.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/updateBatch.html b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/updateBatch.html index 65e1a7b..1774376 100644 --- a/apiDocumentation/interfaces/Query_Drivers_DriverInterface/updateBatch.html +++ b/apiDocumentation/interfaces/Query_Drivers_DriverInterface/updateBatch.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -104,7 +104,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface.html index e800921..e11ef48 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface.html @@ -59,7 +59,7 @@ Methods
  • - Source + Source
  • @@ -127,7 +127,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/columnList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/columnList.html index 1bd550a..34aad89 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/columnList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/columnList.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/dbList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/dbList.html index 7a69f75..bd7135b 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/dbList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/dbList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/explain.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/explain.html index 27f89e3..ad50181 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/explain.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/explain.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/fkList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/fkList.html index b75f8fe..baf8c2a 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/fkList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/fkList.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/functionList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/functionList.html index b81983f..127a07a 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/functionList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/functionList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/indexList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/indexList.html index 466434e..2f6e14f 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/indexList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/indexList.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/limit.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/limit.html index 0a81618..9e15659 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/limit.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/limit.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -77,8 +77,8 @@ $sql, int $limit, - [boolean - $offset = FALSE] ) + [int + $offset = NULL] )

    Parameters

    @@ -93,7 +93,7 @@
    $offset — - boolean
    + int



    Returns

    @@ -104,7 +104,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/procedureList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/procedureList.html index b488f34..853810d 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/procedureList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/procedureList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/random.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/random.html index 102464b..a529e8b 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/random.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/random.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/sequenceList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/sequenceList.html index 8f56582..d48901b 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/sequenceList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/sequenceList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/systemTableList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/systemTableList.html index 82f9f12..e2693e3 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/systemTableList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/systemTableList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/tableList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/tableList.html index 371add3..a91dd9c 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/tableList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/tableList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/triggerList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/triggerList.html index 881f5d5..13750b6 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/triggerList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/triggerList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/typeList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/typeList.html index 26b6f07..2c1266a 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/typeList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/typeList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/viewList.html b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/viewList.html index b12c2e8..86ed615 100644 --- a/apiDocumentation/interfaces/Query_Drivers_SQLInterface/viewList.html +++ b/apiDocumentation/interfaces/Query_Drivers_SQLInterface/viewList.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -81,7 +81,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface.html index a965b8f..85632e4 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface.html @@ -59,7 +59,7 @@ Methods
  • - Source + Source
  • @@ -105,7 +105,7 @@
  • public int countAll()
  • public int countAllResults()
  • public PDOStatement insert() -
  • public PDOStatement insertBatch() +
  • public ?PDOStatement insertBatch()
  • public PDOStatement update()
  • public ?int updateBatch()
  • public PDOStatement delete() @@ -214,7 +214,7 @@
    - Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors + Generated using phpDox 0.12.0-dev - Copyright (C) 2010 - 2020 by Arne Blankerts and Contributors
    diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAll.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAll.html index 2b522d9..d42d0fe 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAll.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAll.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -92,7 +92,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAllResults.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAllResults.html index 6303808..e581f65 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAllResults.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/countAllResults.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/delete.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/delete.html index 2617468..d26d5a8 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/delete.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/delete.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/distinct.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/distinct.html index bfae941..813ba8a 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/distinct.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/distinct.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/explain.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/explain.html index 0889edc..611b143 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/explain.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/explain.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/from.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/from.html index 71957a4..ce5e0f6 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/from.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/from.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/get.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/get.html index a961bfb..8d8f645 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/get.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/get.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -75,10 +75,10 @@
    public function get([string $table = '', - [boolean - $limit = FALSE, - [boolean - $offset = FALSE]]] ) + [int + $limit = NULL, + [int + $offset = NULL]]] )

    Parameters

    @@ -89,11 +89,11 @@
    $limit — - boolean
    + int



    $offset — - boolean
    + int



    Returns

    @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledDelete.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledDelete.html index 632d0c2..ab99f2b 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledDelete.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledDelete.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledInsert.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledInsert.html index f231ca3..0925c7d 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledInsert.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledInsert.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledSelect.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledSelect.html index 9a5acd3..a5072ae 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledSelect.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledSelect.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledUpdate.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledUpdate.html index 0790db8..ad70dbd 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledUpdate.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getCompiledUpdate.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -98,7 +98,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getWhere.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getWhere.html index 719789d..eb3e26b 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/getWhere.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/getWhere.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -77,10 +77,10 @@ $table, [array $where = , - [boolean - $limit = FALSE, - [boolean - $offset = FALSE]]] ) + [int + $limit = NULL, + [int + $offset = NULL]]] )

    Parameters

    @@ -95,11 +95,11 @@
    $limit — - boolean
    + int



    $offset — - boolean
    + int



    Returns

    @@ -111,7 +111,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupBy.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupBy.html index 000fdf5..063f125 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupBy.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupBy.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupEnd.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupEnd.html index 903e16e..a046330 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupEnd.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupEnd.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupStart.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupStart.html index efc5582..dd9b3c3 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupStart.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/groupStart.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/having.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/having.html index 11444a9..db586b0 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/having.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/having.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/insert.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/insert.html index 4872bf4..3309f9a 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/insert.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/insert.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/insertBatch.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/insertBatch.html index 4472ac3..f4d4110 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/insertBatch.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/insertBatch.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,13 +93,13 @@

    Returns

    PDOStatement
    -

    +
    | null
    diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/join.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/join.html index 7ccc5cc..519e305 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/join.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/join.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/like.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/like.html index 3186180..33bd423 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/like.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/like.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/limit.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/limit.html index 64ca406..3898813 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/limit.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/limit.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -75,8 +75,8 @@
    public function limit(int $limit, - [boolean - $offset = FALSE] ) + [int + $offset = NULL] )

    Parameters

    @@ -87,7 +87,7 @@
    $offset — - boolean
    + int



    Returns

    @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/notGroupStart.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/notGroupStart.html index cf24219..0fac4b8 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/notGroupStart.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/notGroupStart.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/notLike.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/notLike.html index a929df7..30b93f1 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/notLike.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/notLike.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orGroupStart.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orGroupStart.html index ef998d2..eae78d7 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orGroupStart.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orGroupStart.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orHaving.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orHaving.html index 9177e00..8d2f77d 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orHaving.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orHaving.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orLike.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orLike.html index e070f2b..92ebdde 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orLike.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orLike.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotGroupStart.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotGroupStart.html index 9c0920b..53af1b9 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotGroupStart.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotGroupStart.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotLike.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotLike.html index 6edfc5d..5317fb1 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotLike.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orNotLike.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhere.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhere.html index 663648e..bcf43ea 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhere.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhere.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereIn.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereIn.html index 42358a8..92a8ddd 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereIn.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereIn.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereNotIn.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereNotIn.html index caedb80..a4097d0 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereNotIn.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orWhereNotIn.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orderBy.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orderBy.html index 8a33bf0..982a01b 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/orderBy.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/orderBy.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/resetQuery.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/resetQuery.html index d9f6560..f2dfcad 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/resetQuery.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/resetQuery.html @@ -59,7 +59,7 @@ Return
  • - Source + Source
  • @@ -82,7 +82,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/select.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/select.html index 8587de7..edc35e5 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/select.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/select.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -93,7 +93,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectAvg.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectAvg.html index fd9c2de..b2797d1 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectAvg.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectAvg.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMax.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMax.html index 3e06598..a87daee 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMax.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMax.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMin.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMin.html index ccc5c02..99478d3 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMin.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectMin.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectSum.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectSum.html index 5b8de4f..703f496 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectSum.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/selectSum.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/set.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/set.html index b6d6021..ef77cb3 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/set.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/set.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/update.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/update.html index 8faf828..76d8a72 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/update.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/update.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/updateBatch.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/updateBatch.html index 39c817c..b1e6d94 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/updateBatch.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/updateBatch.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/where.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/where.html index a6efeb5..3840ed8 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/where.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/where.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -105,7 +105,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereIn.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereIn.html index 2335a89..4b9242a 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereIn.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereIn.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereNotIn.html b/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereNotIn.html index 6d70ac0..ad1c9f9 100644 --- a/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereNotIn.html +++ b/apiDocumentation/interfaces/Query_QueryBuilderInterface/whereNotIn.html @@ -62,7 +62,7 @@ Return
  • - Source + Source
  • @@ -99,7 +99,7 @@ diff --git a/apiDocumentation/namespaces.html b/apiDocumentation/namespaces.html index ce75edf..444d538 100644 --- a/apiDocumentation/namespaces.html +++ b/apiDocumentation/namespaces.html @@ -56,7 +56,7 @@ 1 - 4 + 7 0 @@ -106,7 +106,7 @@ diff --git a/apiDocumentation/source/ConnectionManager.php.html b/apiDocumentation/source/ConnectionManager.php.html index 9d265a6..3b9d57a 100644 --- a/apiDocumentation/source/ConnectionManager.php.html +++ b/apiDocumentation/source/ConnectionManager.php.html @@ -1,3 +1,3 @@ phpDox - Source of ConnectionManager.php

    Source of file ConnectionManager.php

    - Size: 5,131 Bytes - Last Modified: 2019-12-11T15:43:11-05:00

    src/ConnectionManager.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query;

    use DomainException;

    /**
     * Connection manager class to manage connections for the
     * Query method
     */
    final class ConnectionManager {

    	/**
    	 * Map of named database connections
    	 * @var array
    	 */
    	private $connections = [];

    	/**
    	 * Class instance variable
    	 * @var ConnectionManager|null
    	 */
    	private static $instance;

    	/**
    	 * Private constructor to prevent multiple instances
    	 * @codeCoverageIgnore
    	 */
    	private function __construct()
    	{
    	}

    	/**
    	 * Private clone method to prevent cloning
    	 *
    	 * @throws DomainException
    	 * @return void
    	 */
    	public function __clone()
    	{
    		throw new DomainException("Can't clone singleton");
    	}

    	/**
    	 * Prevent serialization of this object
    	 *
    	 * @throws DomainException
    	 * @return void
    	 */
    	public function __sleep()
    	{
    		throw new DomainException('No serializing of singleton');
    	}

    	/**
    	 * Make sure serialize/deserialize doesn't work
    	 *
    	 * @throws DomainException
    	 * @return void
    	 */
    	public function __wakeup()
    	{
    		throw new DomainException("Can't unserialize singleton");
    	}

    	/**
    	 * Return  a connection manager instance
    	 *
    	 * @staticvar null $instance
    	 * @return ConnectionManager
    	 */
    	public static function getInstance(): ConnectionManager
    	{
    		if (self::$instance === NULL)
    		{
    			self::$instance = new self();
    		}

    		return self::$instance;
    	}

    	/**
    	 * Returns the connection specified by the name given
    	 *
    	 * @param string|array|object $name
    	 * @return QueryBuilderInterface
    	 * @throws Exception\NonExistentConnectionException
    	 */
    	public function getConnection($name = ''): QueryBuilderInterface
    	{
    		// If the parameter is a string, use it as an array index
    		if (is_scalar($name) && isset($this->connections[$name]))
    		{
    			return $this->connections[$name];
    		}

    		if (empty($name) && ! empty($this->connections)) // Otherwise, return the last one
    		{
    			return end($this->connections);
    		}

    		// You should actually connect before trying to get a connection...
    		throw new Exception\NonExistentConnectionException('The specified connection does not exist');
    	}

    	/**
    	 * Parse the passed parameters and return a connection
    	 *
    	 * @param object|array $params
    	 * @throws Exception\BadDBDriverException
    	 * @return QueryBuilderInterface
    	 */
    	public function connect($params): QueryBuilderInterface
    	{
    		[$dsn, $dbType, $params, $options] = $this->parseParams($params);

    		$dbType = ucfirst($dbType);
    		$driver = "\\Query\\Drivers\\{$dbType}\\Driver";

    		// Create the database connection
    		$db =  ! empty($params->user)
    			? new $driver($dsn, $params->user, $params->pass, $options)
    			: new $driver($dsn, '', '', $options);

    		// Set the table prefix, if it exists
    		if (isset($params->prefix))
    		{
    			$db->setTablePrefix($params->prefix);
    		}

    		// Create Query Builder object
    		$conn = new QueryBuilder($db, new QueryParser($db));


    		// Save it for later
    		if (isset($params->alias))
    		{
    			$this->connections[$params->alias] = $conn;
    		}
    		else
    		{
    			$this->connections[] = $conn;
    		}

    		return $conn;
    	}

    	/**
    	 * Parses params into a dsn and option array
    	 *
    	 * @param object | array $params
    	 * @return array
    	 * @throws Exception\BadDBDriverException
    	 */
    	public function parseParams($params): array
    	{
    		$params = (object) $params;
    		$params->type = strtolower($params->type);
    		$dbType = ($params->type !== 'postgresql') ? $params->type : 'pgsql';
    		$dbType = ucfirst($dbType);

    		// Make sure the class exists
    		if ( ! class_exists("\\Query\\Drivers\\{$dbType}\\Driver"))
    		{
    			throw new Exception\BadDBDriverException('Database driver does not exist, or is not supported');
    		}

    		// Set additional PDO options
    		$options = [];

    		if (isset($params->options))
    		{
    			$options = (array) $params->options;
    		}

    		// Create the dsn for the database to connect to
    		if(strtolower($dbType) === 'sqlite')
    		{
    			$dsn = $params->file;
    		}
    		else
    		{
    			$dsn = $this->createDsn($dbType, $params);
    		}


    		return [$dsn, $dbType, $params, $options];
    	}

    	/**
    	 * Create the dsn from the db type and params
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $dbType
    	 * @param array|object $params
    	 * @return string
    	 */
    	private function createDsn(string $dbType, $params): string
    	{
    		$pairs = [];

    		if ( ! empty($params->database))
    		{
    			$pairs[] = implode('=', ['dbname', $params->database]);
    		}

    		$skip = [
    			'name' => 'name',
    			'pass' => 'pass',
    			'user' => 'user',
    			'type' => 'type',
    			'prefix' => 'prefix',
    			'options' => 'options',
    			'database' => 'database',
    			'alias' => 'alias'
    		];

    		foreach($params as $key => $val)
    		{
    			if (( ! array_key_exists($key, $skip)) &&  ! empty($val))
    			{
    				$pairs[] = implode('=', [$key, $val]);
    			}
    		}

    		return strtolower($dbType) . ':' . implode(';', $pairs);
    	}
    }
    + Size: 5,219 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/ConnectionManager.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    use DomainException;
    use stdClass;

    /**
     * Connection manager class to manage connections for the
     * Query method
     */
    final class ConnectionManager {

    	/**
    	 * Map of named database connections
    	 * @var array
    	 */
    	private array $connections = [];

    	/**
    	 * Class instance variable
    	 * @var ConnectionManager|null
    	 */
    	private static ?ConnectionManager $instance = NULL;

    	/**
    	 * Private constructor to prevent multiple instances
    	 * @codeCoverageIgnore
    	 */
    	private function __construct()
    	{
    	}

    	/**
    	 * Private clone method to prevent cloning
    	 *
    	 * @throws DomainException
    	 * @return void
    	 */
    	public function __clone()
    	{
    		throw new DomainException("Can't clone singleton");
    	}

    	/**
    	 * Prevent serialization of this object
    	 *
    	 * @throws DomainException
    	 * @return void
    	 */
    	public function __sleep(): void
    	{
    		throw new DomainException('No serializing of singleton');
    	}

    	/**
    	 * Make sure serialize/deserialize doesn't work
    	 *
    	 * @throws DomainException
    	 * @return void
    	 */
    	public function __wakeup(): void
    	{
    		throw new DomainException("Can't unserialize singleton");
    	}

    	/**
    	 * Return  a connection manager instance
    	 *
    	 * @staticvar null $instance
    	 * @return ConnectionManager
    	 */
    	public static function getInstance(): ConnectionManager
    	{
    		if (self::$instance === NULL)
    		{
    			self::$instance = new self();
    		}

    		return self::$instance;
    	}

    	/**
    	 * Returns the connection specified by the name given
    	 *
    	 * @param string|array|object $name
    	 * @return QueryBuilderInterface
    	 * @throws Exception\NonExistentConnectionException
    	 */
    	public function getConnection($name = ''): QueryBuilderInterface
    	{
    		// If the parameter is a string, use it as an array index
    		if (is_scalar($name) && isset($this->connections[$name]))
    		{
    			return $this->connections[$name];
    		}

    		if (empty($name) && ! empty($this->connections)) // Otherwise, return the last one
    		{
    			return end($this->connections);
    		}

    		// You should actually connect before trying to get a connection...
    		throw new Exception\NonExistentConnectionException('The specified connection does not exist');
    	}

    	/**
    	 * Parse the passed parameters and return a connection
    	 *
    	 * @param array|object $params
    	 * @throws Exception\BadDBDriverException
    	 * @return QueryBuilderInterface
    	 */
    	public function connect($params): QueryBuilderInterface
    	{
    		[$dsn, $dbType, $params, $options] = $this->parseParams($params);

    		$dbType = ucfirst($dbType);
    		$driver = "\\Query\\Drivers\\{$dbType}\\Driver";

    		// Create the database connection
    		$db =  ! empty($params->user)
    			? new $driver($dsn, $params->user, $params->pass, $options)
    			: new $driver($dsn, '', '', $options);

    		// Set the table prefix, if it exists
    		if (isset($params->prefix))
    		{
    			$db->setTablePrefix($params->prefix);
    		}

    		// Create Query Builder object
    		$conn = new QueryBuilder($db, new QueryParser($db));


    		// Save it for later
    		if (isset($params->alias))
    		{
    			$this->connections[$params->alias] = $conn;
    		}
    		else
    		{
    			$this->connections[] = $conn;
    		}

    		return $conn;
    	}

    	/**
    	 * Parses params into a dsn and option array
    	 *
    	 * @param array|object $rawParams
    	 * @return array
    	 * @throws Exception\BadDBDriverException
    	 */
    	public function parseParams($rawParams): array
    	{
    		$params = (object) $rawParams;
    		$params->type = strtolower($params->type);
    		$dbType = ($params->type === 'postgresql') ? 'pgsql' : $params->type;
    		$dbType = ucfirst($dbType);

    		// Make sure the class exists
    		if ( ! class_exists("\\Query\\Drivers\\{$dbType}\\Driver"))
    		{
    			throw new Exception\BadDBDriverException('Database driver does not exist, or is not supported');
    		}

    		// Set additional PDO options
    		$options = [];

    		if (isset($params->options))
    		{
    			$options = (array) $params->options;
    		}

    		// Create the dsn for the database to connect to
    		if(strtolower($dbType) === 'sqlite')
    		{
    			$dsn = $params->file;
    		}
    		else
    		{
    			$dsn = $this->createDsn($dbType, $params);
    		}


    		return [$dsn, $dbType, $params, $options];
    	}

    	/**
    	 * Create the dsn from the db type and params
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $dbType
    	 * @param stdClass $params
    	 * @return string
    	 */
    	private function createDsn(string $dbType, stdClass $params): string
    	{
    		$pairs = [];

    		if ( ! empty($params->database))
    		{
    			$pairs[] = implode('=', ['dbname', $params->database]);
    		}

    		$skip = [
    			'name' => 'name',
    			'pass' => 'pass',
    			'user' => 'user',
    			'type' => 'type',
    			'prefix' => 'prefix',
    			'options' => 'options',
    			'database' => 'database',
    			'alias' => 'alias'
    		];

    		foreach($params as $key => $val)
    		{
    			if (( ! array_key_exists($key, $skip)) &&  ! empty($val))
    			{
    				$pairs[] = implode('=', [$key, $val]);
    			}
    		}

    		return strtolower($dbType) . ':' . implode(';', $pairs);
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/AbstractDriver.php.html b/apiDocumentation/source/Drivers/AbstractDriver.php.html index ded3213..4ca8a1c 100644 --- a/apiDocumentation/source/Drivers/AbstractDriver.php.html +++ b/apiDocumentation/source/Drivers/AbstractDriver.php.html @@ -1,3 +1,3 @@ phpDox - Source of AbstractDriver.php

    Source of file AbstractDriver.php

    - Size: 15,042 Bytes - Last Modified: 2019-12-11T14:57:29-05:00

    src/Drivers/AbstractDriver.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers;

    use function dbFilter;

    use InvalidArgumentException;
    use PDO;
    use PDOStatement;

    /**
     * Base Database class
     *
     * Extends PDO to simplify cross-database issues
     */
    abstract class AbstractDriver
    	extends PDO
    	implements DriverInterface {

    	/**
    	 * Reference to the last executed query
    	 * @var PDOStatement
    	 */
    	protected $statement;

    	/**
    	 * Start character to escape identifiers
    	 * @var string
    	 */
    	protected $escapeCharOpen = '"';

    	/**
    	 * End character to escape identifiers
    	 * @var string
    	 */
    	protected $escapeCharClose = '"';

    	/**
    	 * Reference to sql class
    	 * @var SQLInterface
    	 */
    	protected $sql;

    	/**
    	 * Reference to util class
    	 * @var AbstractUtil
    	 */
    	protected $util;

    	/**
    	 * Last query executed
    	 * @var string
    	 */
    	protected $lastQuery = '';

    	/**
    	 * Prefix to apply to table names
    	 * @var string
    	 */
    	protected $tablePrefix = '';

    	/**
    	 * Whether the driver supports 'TRUNCATE'
    	 * @var boolean
    	 */
    	protected $hasTruncate = TRUE;

    	/**
    	 * PDO constructor wrapper
    	 *
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array $driverOptions
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $driverOptions=[])
    	{
    		// Set PDO to display errors as exceptions, and apply driver options
    		$driverOptions[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
    		parent::__construct($dsn, $username, $password, $driverOptions);

    		$this->_loadSubClasses();
    	}

    	/**
    	 * Loads the subclasses for the driver
    	 *
    	 * @return void
    	 */
    	protected function _loadSubClasses(): void
    	{
    		// Load the sql and util class for the driver
    		$thisClass = \get_class($this);
    		$nsArray = explode("\\", $thisClass);
    		array_pop($nsArray);
    		$driver = array_pop($nsArray);
    		$sqlClass = __NAMESPACE__ . "\\{$driver}\\SQL";
    		$utilClass = __NAMESPACE__ . "\\{$driver}\\Util";

    		$this->sql = new $sqlClass();
    		$this->util = new $utilClass($this);
    	}

    	/**
    	 * Allow invoke to work on table object
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $name
    	 * @param array $args
    	 * @return mixed
    	 */
    	public function __call(string $name, array $args = [])
    	{
    		if (
    			isset($this->$name)
    			&& \is_object($this->$name)
    			&& method_exists($this->$name, '__invoke')
    		)
    		{
    			return \call_user_func_array([$this->$name, '__invoke'], $args);
    		}

    		return NULL;
    	}

    	// --------------------------------------------------------------------------
    	// ! Accessors / Mutators
    	// --------------------------------------------------------------------------

    	/**
    	 * Get the last sql query executed
    	 *
    	 * @return string
    	 */
    	public function getLastQuery(): string
    	{
    		return $this->lastQuery;
    	}

    	/**
    	 * Set the last query sql
    	 *
    	 * @param string $queryString
    	 * @return void
    	 */
    	public function setLastQuery(string $queryString): void
    	{
    		$this->lastQuery = $queryString;
    	}

    	/**
    	 * Get the SQL class for the current driver
    	 *
    	 * @return SQLInterface
    	 */
    	public function getSql(): SQLInterface
    	{
    		return $this->sql;
    	}

    	/**
    	 * Get the Util class for the current driver
    	 *
    	 * @return AbstractUtil
    	 */
    	public function getUtil(): AbstractUtil
    	{
    		return $this->util;
    	}

    	/**
    	 * Set the common table name prefix
    	 *
    	 * @param string $prefix
    	 * @return void
    	 */
    	public function setTablePrefix(string $prefix): void
    	{
    		$this->tablePrefix = $prefix;
    	}

    	// --------------------------------------------------------------------------
    	// ! Concrete functions that can be overridden in child classes
    	// --------------------------------------------------------------------------

    	/**
    	 * Simplifies prepared statements for database queries
    	 *
    	 * @param string $sql
    	 * @param array $data
    	 * @return PDOStatement | FALSE
    	 * @throws InvalidArgumentException
    	 */
    	public function prepareQuery(string $sql, array $data): PDOStatement
    	{
    		// Prepare the sql, save the statement for easy access later
    		$this->statement = $this->prepare($sql);

    		// Bind the parameters
    		foreach($data as $k => $value)
    		{
    			// Parameters are 1-based, the data is 0-based
    			// So, if the key is numeric, add 1
    			if(is_numeric($k))
    			{
    				$k++;
    			}
    			$this->statement->bindValue($k, $value);
    		}

    		return $this->statement;
    	}

    	/**
    	 * Create and execute a prepared statement with the provided parameters
    	 *
    	 * @param string $sql
    	 * @param array $params
    	 * @throws InvalidArgumentException
    	 * @return PDOStatement
    	 */
    	public function prepareExecute(string $sql, array $params): PDOStatement
    	{
    		$this->statement = $this->prepareQuery($sql, $params);
    		$this->statement->execute();

    		return $this->statement;
    	}

    	/**
    	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
    	 *
    	 * @return int
    	 */
    	public function affectedRows(): int
    	{
    		// Return number of rows affected
    		return $this->statement->rowCount();
    	}

    	/**
    	 * Prefixes a table if it is not already prefixed
    	 * @param string $table
    	 * @return string
    	 */
    	public function prefixTable(string $table): string
    	{
    		// Add the prefix to the table name
    		// before quoting it
    		if ( ! empty($this->tablePrefix))
    		{
    			// Split identifier by period, will split into:
    			// database.schema.table OR
    			// schema.table OR
    			// database.table OR
    			// table
    			$identifiers = explode('.', $table);
    			$segments = count($identifiers);

    			// Quote the last item, and add the database prefix
    			$identifiers[$segments - 1] = $this->_prefix(end($identifiers));

    			// Rejoin
    			$table = implode('.', $identifiers);
    		}

    		return $table;
    	}

    	/**
    	 * Quote database table name, and set prefix
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function quoteTable($table): string
    	{
    		$table = $this->prefixTable($table);

    		// Finally, quote the table
    		return $this->quoteIdent($table);
    	}

    	/**
    	 * Surrounds the string with the databases identifier escape characters
    	 *
    	 * @param mixed $identifier
    	 * @return string|array
    	 */
    	public function quoteIdent($identifier)
    	{
    		if (is_array($identifier))
    		{
    			return array_map([$this, __METHOD__], $identifier);
    		}

    		// Handle comma-separated identifiers
    		if (strpos($identifier, ',') !== FALSE)
    		{
    			$parts = array_map('mb_trim', explode(',', $identifier));
    			$parts = array_map([$this, __METHOD__], $parts);
    			$identifier = implode(',', $parts);
    		}

    		// Split each identifier by the period
    		$hiers = explode('.', $identifier);
    		$hiers = array_map('mb_trim', $hiers);

    		// Re-compile the string
    		$raw = implode('.', array_map([$this, '_quote'], $hiers));

    		// Fix functions
    		$funcs = [];
    		preg_match_all("#{$this->escapeCharOpen}([a-zA-Z0-9_]+(\((.*?)\))){$this->escapeCharClose}#iu", $raw, $funcs, PREG_SET_ORDER);
    		foreach($funcs as $f)
    		{
    			// Unquote the function
    			// Quote the inside identifiers
    			$raw = str_replace(array($f[0], $f[3]), array($f[1], $this->quoteIdent($f[3])), $raw);
    		}

    		return $raw;
    	}

    	/**
    	 * Return schemas for databases that list them
    	 *
    	 * @return array
    	 */
    	public function getSchemas(): ?array
    	{
    		// Most DBMSs conflate schemas and databases
    		return $this->getDbs();
    	}

    	/**
    	 * Return list of tables for the current database
    	 *
    	 * @return array
    	 */
    	public function getTables(): ?array
    	{
    		$tables = $this->driverQuery('tableList');
    		natsort($tables);
    		return $tables;
    	}

    	/**
    	 * Return list of dbs for the current connection, if possible
    	 *
    	 * @return array
    	 */
    	public function getDbs(): ?array
    	{
    		return $this->driverQuery('dbList');
    	}

    	/**
    	 * Return list of views for the current database
    	 *
    	 * @return array
    	 */
    	public function getViews(): ?array
    	{
    		$views = $this->driverQuery('viewList');
    		sort($views);
    		return $views;
    	}

    	/**
    	 * Return list of sequences for the current database, if they exist
    	 *
    	 * @return array
    	 */
    	public function getSequences(): ?array
    	{
    		return $this->driverQuery('sequenceList');
    	}

    	/**
    	 * Return list of functions for the current database
    	 *
    	 * @return array
    	 */
    	public function getFunctions(): ?array
    	{
    		return $this->driverQuery('functionList', FALSE);
    	}

    	/**
    	 * Return list of stored procedures for the current database
    	 *
    	 * @return array
    	 */
    	public function getProcedures(): ?array
    	{
    		return $this->driverQuery('procedureList', FALSE);
    	}

    	/**
    	 * Return list of triggers for the current database
    	 *
    	 * @return array
    	 */
    	public function getTriggers(): ?array
    	{
    		return $this->driverQuery('triggerList', FALSE);
    	}

    	/**
    	 * Retrieves an array of non-user-created tables for
    	 * the connection/database
    	 *
    	 * @return array
    	 */
    	public function getSystemTables(): ?array
    	{
    		return $this->driverQuery('systemTableList');
    	}

    	/**
    	 * Retrieve column information for the current database table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getColumns(string $table): ?array
    	{
    		return $this->driverQuery($this->getSql()->columnList($this->prefixTable($table)), FALSE);
    	}

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks(string $table): ?array
    	{
    		return $this->driverQuery($this->getSql()->fkList($table), FALSE);
    	}

    	/**
    	 * Retrieve indexes for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getIndexes(string $table): ?array
    	{
    		return $this->driverQuery($this->getSql()->indexList($this->prefixTable($table)), FALSE);
    	}

    	/**
    	 * Retrieve list of data types for the database
    	 *
    	 * @return array
    	 */
    	public function getTypes(): ?array
    	{
    		return $this->driverQuery('typeList', FALSE);
    	}

    	/**
    	 * Method to simplify retrieving db results for meta-data queries
    	 *
    	 * @param string|array|null $query
    	 * @param bool $filteredIndex
    	 * @return array|null
    	 */
    	public function driverQuery($query, $filteredIndex=TRUE): ?array
    	{
    		// Call the appropriate method, if it exists
    		if (is_string($query) && method_exists($this->sql, $query))
    		{
    			$query = $this->getSql()->$query();
    		}

    		// Return if the values are returned instead of a query,
    		// or if the query doesn't apply to the driver
    		if ( ! is_string($query))
    		{
    			return $query;
    		}

    		// Run the query!
    		$res = $this->query($query);

    		$flag = $filteredIndex ? PDO::FETCH_NUM : PDO::FETCH_ASSOC;
    		$all = $res->fetchAll($flag);

    		return $filteredIndex ? dbFilter($all, 0) : $all;
    	}

    	/**
    	 * Return the number of rows returned for a SELECT query
    	 *
    	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
    	 * @return int|null
    	 */
    	public function numRows(): ?int
    	{
    		$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
    		$output = [];

    		if (preg_match($regex, $this->lastQuery, $output) > 0)
    		{
    			$stmt = $this->query("SELECT COUNT(*) FROM {$output[1]}");
    			return (int) $stmt->fetchColumn();
    		}

    		return NULL;
    	}

    	/**
    	 * Create sql for batch insert
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return array<string|array|null>
    	 */
    	public function insertBatch(string $table, array $data=[]): array
    	{
    		$data = (array) $data;
    		$firstRow = (array) current($data);

    		// Values for insertion
    		$vals = [];
    		foreach($data as $group)
    		{
    			$vals = array_merge($vals, array_values($group));
    		}

    		$table = $this->quoteTable($table);
    		$fields = array_keys($firstRow);

    		$sql = "INSERT INTO {$table} ("
    			. implode(',', $this->quoteIdent($fields))
    			. ') VALUES ';

    		// Create the placeholder groups
    		$params = array_fill(0, count($fields), '?');
    		$paramString = '(' . implode(',', $params) . ')';
    		$paramList = array_fill(0, count($data), $paramString);

    		// Append the placeholder groups to the query
    		$sql .= implode(',', $paramList);

    		return [$sql, $vals];
    	}

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table The table to update
    	 * @param array $data an array of update values
    	 * @param string $where The where key
    	 * @return array<string,array,int>
    	 */
    	public function updateBatch(string $table, array $data, string $where): array
    	{
    		$affectedRows = 0;
    		$insertData = [];
    		$fieldLines = [];

    		$sql = 'UPDATE ' . $this->quoteTable($table) . ' SET ';

    		// Get the keys of the current set of data, except the one used to
    		// set the update condition
    		$fields = array_unique(
    			array_reduce($data, static function ($previous, $current) use (&$affectedRows, $where) {
    				$affectedRows++;
    				$keys = array_diff(array_keys($current), [$where]);

    				if ($previous === NULL)
    				{
    					return $keys;
    				}

    				return array_merge($previous, $keys);
    			})
    		);

    		// Create the CASE blocks for each data set
    		foreach ($fields as $field)
    		{
    			$line =  $this->quoteIdent($field) . " = CASE\n";

    			$cases = [];
    			foreach ($data as $case)
    			{
    				if (array_key_exists($field, $case))
    				{
    					$insertData[] = $case[$where];
    					$insertData[] = $case[$field];
    					$cases[] = 'WHEN ' . $this->quoteIdent($where) . ' =? '
    						. 'THEN ? ';
    				}
    			}

    			$line .= implode("\n", $cases) . "\n";
    			$line .= 'ELSE ' . $this->quoteIdent($field) . ' END';

    			$fieldLines[] = $line;
    		}

    		$sql .= implode(",\n", $fieldLines) . "\n";

    		$whereValues = array_column($data, $where);
    		foreach ($whereValues as $value)
    		{
    			$insertData[] = $value;
    		}

    		// Create the placeholders for the WHERE IN clause
    		$placeholders = array_fill(0, count($whereValues), '?');

    		$sql .= 'WHERE ' . $this->quoteIdent($where) . ' IN ';
    		$sql .= '(' . implode(',', $placeholders) . ')';

    		return [$sql, $insertData, $affectedRows];
    	}

    	/**
    	 * Empty the passed table
    	 *
    	 * @param string $table
    	 * @return PDOStatement
    	 */
    	public function truncate(string $table): PDOStatement
    	{
    		$sql = $this->hasTruncate
    			? 'TRUNCATE TABLE '
    			: 'DELETE FROM ';

    		$sql .= $this->quoteTable($table);

    		$this->statement = $this->query($sql);
    		return $this->statement;
    	}

    	/**
    	 * Helper method for quote_ident
    	 *
    	 * @param mixed $str
    	 * @return mixed
    	 */
    	public function _quote($str)
    	{
    		// Check that the current value is a string,
    		// and is not already quoted before quoting
    		// that value, otherwise, return the original value
    		return (
    			\is_string($str)
    			&& strpos($str, $this->escapeCharOpen) !== 0
    			&& strrpos($str, $this->escapeCharClose) !== 0
    		)
    			? "{$this->escapeCharOpen}{$str}{$this->escapeCharClose}"
    			: $str;

    	}

    	/**
    	 * Sets the table prefix on the passed string
    	 *
    	 * @param string $str
    	 * @return string
    	 */
    	protected function _prefix(string $str): string
    	{
    		// Don't prefix an already prefixed table
    		if (strpos($str, $this->tablePrefix) !== FALSE)
    		{
    			return $str;
    		}

    		return $this->tablePrefix . $str;
    	}
    }

    + Size: 15,613 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/AbstractDriver.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers;

    use function dbFilter;

    use InvalidArgumentException;
    use PDO;
    use PDOStatement;
    use function is_string;

    /**
     * Base Database class
     *
     * Extends PDO to simplify cross-database issues
     */
    abstract class AbstractDriver
    	extends PDO
    	implements DriverInterface {

    	/**
    	 * Reference to the last executed query
    	 * @var PDOStatement
    	 */
    	protected PDOStatement $statement;

    	/**
    	 * Start character to escape identifiers
    	 * @var string
    	 */
    	protected string $escapeCharOpen = '"';

    	/**
    	 * End character to escape identifiers
    	 * @var string
    	 */
    	protected string $escapeCharClose = '"';

    	/**
    	 * Reference to sql class
    	 * @var SQLInterface
    	 */
    	protected SQLInterface $driverSQL;

    	/**
    	 * Reference to util class
    	 * @var AbstractUtil
    	 */
    	protected AbstractUtil $util;

    	/**
    	 * Last query executed
    	 * @var string
    	 */
    	protected string $lastQuery = '';

    	/**
    	 * Prefix to apply to table names
    	 * @var string
    	 */
    	protected string $tablePrefix = '';

    	/**
    	 * Whether the driver supports 'TRUNCATE'
    	 * @var boolean
    	 */
    	protected bool $hasTruncate = TRUE;

    	/**
    	 * PDO constructor wrapper
    	 *
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array $driverOptions
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $driverOptions=[])
    	{
    		// Set PDO to display errors as exceptions, and apply driver options
    		$driverOptions[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
    		parent::__construct($dsn, $username, $password, $driverOptions);

    		$this->_loadSubClasses();
    	}

    	/**
    	 * Loads the subclasses for the driver
    	 *
    	 * @return void
    	 */
    	protected function _loadSubClasses(): void
    	{
    		// Load the sql and util class for the driver
    		$thisClass = \get_class($this);
    		$nsArray = explode("\\", $thisClass);
    		array_pop($nsArray);
    		$driver = array_pop($nsArray);
    		$sqlClass = __NAMESPACE__ . "\\{$driver}\\SQL";
    		$utilClass = __NAMESPACE__ . "\\{$driver}\\Util";

    		$this->driverSQL = new $sqlClass();
    		$this->util = new $utilClass($this);
    	}

    	/**
    	 * Allow invoke to work on table object
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $name
    	 * @param array $args
    	 * @return mixed
    	 */
    	public function __call(string $name, array $args = [])
    	{
    		if (
    			isset($this->$name)
    			&& \is_object($this->$name)
    			&& method_exists($this->$name, '__invoke')
    		)
    		{
    			return \call_user_func_array([$this->$name, '__invoke'], $args);
    		}

    		return NULL;
    	}

    	// --------------------------------------------------------------------------
    	// ! Accessors / Mutators
    	// --------------------------------------------------------------------------

    	/**
    	 * Get the last sql query executed
    	 *
    	 * @return string
    	 */
    	public function getLastQuery(): string
    	{
    		return $this->lastQuery;
    	}

    	/**
    	 * Set the last query sql
    	 *
    	 * @param string $queryString
    	 * @return void
    	 */
    	public function setLastQuery(string $queryString): void
    	{
    		$this->lastQuery = $queryString;
    	}

    	/**
    	 * Get the SQL class for the current driver
    	 *
    	 * @return SQLInterface
    	 */
    	public function getSql(): SQLInterface
    	{
    		return $this->driverSQL;
    	}

    	/**
    	 * Get the Util class for the current driver
    	 *
    	 * @return AbstractUtil
    	 */
    	public function getUtil(): AbstractUtil
    	{
    		return $this->util;
    	}

    	/**
    	 * Set the common table name prefix
    	 *
    	 * @param string $prefix
    	 * @return void
    	 */
    	public function setTablePrefix(string $prefix): void
    	{
    		$this->tablePrefix = $prefix;
    	}

    	// --------------------------------------------------------------------------
    	// ! Concrete functions that can be overridden in child classes
    	// --------------------------------------------------------------------------

    	/**
    	 * Simplifies prepared statements for database queries
    	 *
    	 * @param string $sql
    	 * @param array $data
    	 * @return PDOStatement | FALSE
    	 * @throws InvalidArgumentException
    	 */
    	public function prepareQuery(string $sql, array $data): PDOStatement
    	{
    		// Prepare the sql, save the statement for easy access later
    		$this->statement = $this->prepare($sql);

    		// Bind the parameters
    		foreach($data as $k => $value)
    		{
    			// Parameters are 1-based, the data is 0-based
    			// So, if the key is numeric, add 1
    			if(is_numeric($k))
    			{
    				$k++;
    			}
    			$this->statement->bindValue($k, $value);
    		}

    		return $this->statement;
    	}

    	/**
    	 * Create and execute a prepared statement with the provided parameters
    	 *
    	 * @param string $sql
    	 * @param array $params
    	 * @throws InvalidArgumentException
    	 * @return PDOStatement
    	 */
    	public function prepareExecute(string $sql, array $params): PDOStatement
    	{
    		$this->statement = $this->prepareQuery($sql, $params);
    		$this->statement->execute();

    		return $this->statement;
    	}

    	/**
    	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
    	 *
    	 * @return int
    	 */
    	public function affectedRows(): int
    	{
    		// Return number of rows affected
    		return $this->statement->rowCount();
    	}

    	/**
    	 * Prefixes a table if it is not already prefixed
    	 * @param string $table
    	 * @return string
    	 */
    	public function prefixTable(string $table): string
    	{
    		// Add the prefix to the table name
    		// before quoting it
    		if ( ! empty($this->tablePrefix))
    		{
    			// Split identifier by period, will split into:
    			// database.schema.table OR
    			// schema.table OR
    			// database.table OR
    			// table
    			$identifiers = explode('.', $table);
    			$segments = count($identifiers);

    			// Quote the last item, and add the database prefix
    			$identifiers[$segments - 1] = $this->_prefix(end($identifiers));

    			// Rejoin
    			$table = implode('.', $identifiers);
    		}

    		return $table;
    	}

    	/**
    	 * Quote database table name, and set prefix
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function quoteTable($table): string
    	{
    		$table = $this->prefixTable($table);

    		// Finally, quote the table
    		return $this->quoteIdent($table);
    	}

    	/**
    	 * Surrounds the string with the databases identifier escape characters
    	 *
    	 * @param mixed $identifier
    	 * @return string|array
    	 */
    	public function quoteIdent($identifier)
    	{
    		if (is_array($identifier))
    		{
    			return array_map([$this, __METHOD__], $identifier);
    		}

    		// Handle comma-separated identifiers
    		if (strpos($identifier, ',') !== FALSE)
    		{
    			$parts = array_map('mb_trim', explode(',', $identifier));
    			$parts = array_map([$this, __METHOD__], $parts);
    			$identifier = implode(',', $parts);
    		}

    		// Split each identifier by the period
    		$hiers = explode('.', $identifier);
    		$hiers = array_map('mb_trim', $hiers);

    		// Re-compile the string
    		$raw = implode('.', array_map([$this, '_quote'], $hiers));

    		// Fix functions
    		$funcs = [];
    		preg_match_all("#{$this->escapeCharOpen}([a-zA-Z0-9_]+(\((.*?)\))){$this->escapeCharClose}#iu", $raw, $funcs, PREG_SET_ORDER);
    		foreach($funcs as $f)
    		{
    			// Unquote the function
    			// Quote the inside identifiers
    			$raw = str_replace(array($f[0], $f[3]), array($f[1], $this->quoteIdent($f[3])), $raw);
    		}

    		return $raw;
    	}

    	/**
    	 * Return schemas for databases that list them
    	 *
    	 * @return array
    	 */
    	public function getSchemas(): ?array
    	{
    		// Most DBMSs conflate schemas and databases
    		return $this->getDbs();
    	}

    	/**
    	 * Return list of tables for the current database
    	 *
    	 * @return array
    	 */
    	public function getTables(): ?array
    	{
    		$tables = $this->driverQuery('tableList');
    		natsort($tables);
    		return $tables;
    	}

    	/**
    	 * Return list of dbs for the current connection, if possible
    	 *
    	 * @return array
    	 */
    	public function getDbs(): ?array
    	{
    		return $this->driverQuery('dbList');
    	}

    	/**
    	 * Return list of views for the current database
    	 *
    	 * @return array
    	 */
    	public function getViews(): ?array
    	{
    		$views = $this->driverQuery('viewList');
    		sort($views);
    		return $views;
    	}

    	/**
    	 * Return list of sequences for the current database, if they exist
    	 *
    	 * @return array
    	 */
    	public function getSequences(): ?array
    	{
    		return $this->driverQuery('sequenceList');
    	}

    	/**
    	 * Return list of functions for the current database
    	 *
    	 * @return array
    	 */
    	public function getFunctions(): ?array
    	{
    		return $this->driverQuery('functionList', FALSE);
    	}

    	/**
    	 * Return list of stored procedures for the current database
    	 *
    	 * @return array
    	 */
    	public function getProcedures(): ?array
    	{
    		return $this->driverQuery('procedureList', FALSE);
    	}

    	/**
    	 * Return list of triggers for the current database
    	 *
    	 * @return array
    	 */
    	public function getTriggers(): ?array
    	{
    		return $this->driverQuery('triggerList', FALSE);
    	}

    	/**
    	 * Retrieves an array of non-user-created tables for
    	 * the connection/database
    	 *
    	 * @return array
    	 */
    	public function getSystemTables(): ?array
    	{
    		return $this->driverQuery('systemTableList');
    	}

    	/**
    	 * Retrieve column information for the current database table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getColumns(string $table): ?array
    	{
    		return $this->driverQuery($this->getSql()->columnList($this->prefixTable($table)), FALSE);
    	}

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks(string $table): ?array
    	{
    		return $this->driverQuery($this->getSql()->fkList($table), FALSE);
    	}

    	/**
    	 * Retrieve indexes for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getIndexes(string $table): ?array
    	{
    		return $this->driverQuery($this->getSql()->indexList($this->prefixTable($table)), FALSE);
    	}

    	/**
    	 * Retrieve list of data types for the database
    	 *
    	 * @return array
    	 */
    	public function getTypes(): ?array
    	{
    		return $this->driverQuery('typeList', FALSE);
    	}

    	/**
    	 * Get the version of the database engine
    	 *
    	 * @return string
    	 */
    	public function getVersion(): string
    	{
    		return $this->getAttribute(PDO::ATTR_SERVER_VERSION);
    	}

    	/**
    	 * Method to simplify retrieving db results for meta-data queries
    	 *
    	 * @param string|array|null $query
    	 * @param bool $filteredIndex
    	 * @return array|null
    	 */
    	public function driverQuery($query, $filteredIndex=TRUE): ?array
    	{
    		// Call the appropriate method, if it exists
    		if (is_string($query) && method_exists($this->driverSQL, $query))
    		{
    			$query = $this->getSql()->$query();
    		}

    		// Return if the values are returned instead of a query,
    		// or if the query doesn't apply to the driver
    		if ( ! is_string($query))
    		{
    			return $query;
    		}

    		// Run the query!
    		$res = $this->query($query);

    		$flag = $filteredIndex ? PDO::FETCH_NUM : PDO::FETCH_ASSOC;
    		$all = $res->fetchAll($flag);

    		return $filteredIndex ? dbFilter($all, 0) : $all;
    	}

    	/**
    	 * Return the number of rows returned for a SELECT query
    	 *
    	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
    	 * @return int|null
    	 */
    	public function numRows(): ?int
    	{
    		$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
    		$output = [];

    		if (preg_match($regex, $this->lastQuery, $output) > 0)
    		{
    			$stmt = $this->query("SELECT COUNT(*) FROM {$output[1]}");
    			return (int) $stmt->fetchColumn();
    		}

    		return NULL;
    	}

    	/**
    	 * Create sql for batch insert
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return array<string|array|null>
    	 */
    	public function insertBatch(string $table, array $data=[]): array
    	{
    		$data = (array) $data;
    		$firstRow = (array) current($data);

    		// Values for insertion
    		$vals = [];
    		foreach($data as $group)
    		{
    			$vals = array_merge($vals, array_values($group));
    		}

    		$table = $this->quoteTable($table);
    		$fields = array_keys($firstRow);

    		$sql = "INSERT INTO {$table} ("
    			. implode(',', $this->quoteIdent($fields))
    			. ') VALUES ';

    		// Create the placeholder groups
    		$params = array_fill(0, count($fields), '?');
    		$paramString = '(' . implode(',', $params) . ')';
    		$paramList = array_fill(0, count($data), $paramString);

    		// Append the placeholder groups to the query
    		$sql .= implode(',', $paramList);

    		return [$sql, $vals];
    	}

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table The table to update
    	 * @param array $data an array of update values
    	 * @param string $where The where key
    	 * @return array<string,array,int>
    	 */
    	public function updateBatch(string $table, array $data, string $where): array
    	{
    		$affectedRows = 0;
    		$insertData = [];
    		$fieldLines = [];

    		$sql = 'UPDATE ' . $this->quoteTable($table) . ' SET ';

    		// Get the keys of the current set of data, except the one used to
    		// set the update condition
    		$fields = array_unique(
    			array_reduce($data, static function ($previous, $current) use (&$affectedRows, $where) {
    				$affectedRows++;
    				$keys = array_diff(array_keys($current), [$where]);

    				if ($previous === NULL)
    				{
    					return $keys;
    				}

    				return array_merge($previous, $keys);
    			})
    		);

    		// Create the CASE blocks for each data set
    		foreach ($fields as $field)
    		{
    			$line =  $this->quoteIdent($field) . " = CASE\n";

    			$cases = [];
    			foreach ($data as $case)
    			{
    				if (array_key_exists($field, $case))
    				{
    					$insertData[] = $case[$where];
    					$insertData[] = $case[$field];
    					$cases[] = 'WHEN ' . $this->quoteIdent($where) . ' =? '
    						. 'THEN ? ';
    				}
    			}

    			$line .= implode("\n", $cases) . "\n";
    			$line .= 'ELSE ' . $this->quoteIdent($field) . ' END';

    			$fieldLines[] = $line;
    		}

    		$sql .= implode(",\n", $fieldLines) . "\n";

    		$whereValues = array_column($data, $where);
    		foreach ($whereValues as $value)
    		{
    			$insertData[] = $value;
    		}

    		// Create the placeholders for the WHERE IN clause
    		$placeholders = array_fill(0, count($whereValues), '?');

    		$sql .= 'WHERE ' . $this->quoteIdent($where) . ' IN ';
    		$sql .= '(' . implode(',', $placeholders) . ')';

    		return [$sql, $insertData, $affectedRows];
    	}

    	/**
    	 * Empty the passed table
    	 *
    	 * @param string $table
    	 * @return PDOStatement
    	 */
    	public function truncate(string $table): PDOStatement
    	{
    		$sql = $this->hasTruncate
    			? 'TRUNCATE TABLE '
    			: 'DELETE FROM ';

    		$sql .= $this->quoteTable($table);

    		$this->statement = $this->query($sql);
    		return $this->statement;
    	}

    	/**
    	 * Generate the returning clause for the current database
    	 *
    	 * @param string $query
    	 * @param string $select
    	 * @return string
    	 */
    	public function returning(string $query, string $select): string
    	{
    		return "{$query} RETURNING {$select}";
    	}

    	/**
    	 * Helper method for quote_ident
    	 *
    	 * @param mixed $str
    	 * @return mixed
    	 */
    	public function _quote($str)
    	{
    		// Check that the current value is a string,
    		// and is not already quoted before quoting
    		// that value, otherwise, return the original value
    		return (
    			is_string($str)
    			&& strpos($str, $this->escapeCharOpen) !== 0
    			&& strrpos($str, $this->escapeCharClose) !== 0
    		)
    			? "{$this->escapeCharOpen}{$str}{$this->escapeCharClose}"
    			: $str;

    	}

    	/**
    	 * Sets the table prefix on the passed string
    	 *
    	 * @param string $str
    	 * @return string
    	 */
    	protected function _prefix(string $str): string
    	{
    		// Don't prefix an already prefixed table
    		if (strpos($str, $this->tablePrefix) !== FALSE)
    		{
    			return $str;
    		}

    		return $this->tablePrefix . $str;
    	}
    }

    diff --git a/apiDocumentation/source/Drivers/AbstractSQL.php.html b/apiDocumentation/source/Drivers/AbstractSQL.php.html index 01adc9f..4b09649 100644 --- a/apiDocumentation/source/Drivers/AbstractSQL.php.html +++ b/apiDocumentation/source/Drivers/AbstractSQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of AbstractSQL.php

    Source of file AbstractSQL.php

    - Size: 0,847 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Drivers/AbstractSQL.php

    123456789101112131415161718192021222324252627282930313233343536373839404142
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers;

    /**
     * Parent for database-specific syntax subclasses
     */
    abstract class AbstractSQL implements SQLInterface {

    	/**
    	 * Limit clause
    	 *
    	 * @param string $sql
    	 * @param int $limit
    	 * @param int|bool $offset
    	 * @return string
    	 */
    	public function limit(string $sql, int $limit, $offset=FALSE): string
    	{
    		$sql .= "\nLIMIT {$limit}";

    		if (is_numeric($offset))
    		{
    			$sql .= " OFFSET {$offset}";
    		}

    		return $sql;
    	}
    }

    + Size: 0,864 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/AbstractSQL.php

    12345678910111213141516171819202122232425262728293031323334353637383940414243
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers;

    /**
     * Parent for database-specific syntax subclasses
     */
    abstract class AbstractSQL implements SQLInterface {

    	/**
    	 * Limit clause
    	 *
    	 * @param string $sql
    	 * @param int $limit
    	 * @param int $offset
    	 * @return string
    	 */
    	public function limit(string $sql, int $limit, ?int $offset=NULL): string
    	{
    		$sql .= "\nLIMIT {$limit}";

    		if (is_numeric($offset))
    		{
    			$sql .= " OFFSET {$offset}";
    		}

    		return $sql;
    	}
    }

    diff --git a/apiDocumentation/source/Drivers/AbstractUtil.php.html b/apiDocumentation/source/Drivers/AbstractUtil.php.html index d18ad55..649f5bc 100644 --- a/apiDocumentation/source/Drivers/AbstractUtil.php.html +++ b/apiDocumentation/source/Drivers/AbstractUtil.php.html @@ -1,3 +1,3 @@ phpDox - Source of AbstractUtil.php

    Source of file AbstractUtil.php

    - Size: 2,870 Bytes - Last Modified: 2019-12-11T16:05:29-05:00

    src/Drivers/AbstractUtil.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers;

    /**
     * Abstract class defining database / table creation methods
     */
    abstract class AbstractUtil {

    	/**
    	 * Reference to the current connection object
    	 * @var DriverInterface
    	 */
    	private $connection;

    	/**
    	 * Save a reference to the connection object for later use
    	 *
    	 * @param DriverInterface $connection
    	 */
    	public function __construct(DriverInterface $connection)
    	{
    		$this->connection = $connection;
    	}

    	/**
    	 * Get the driver object for the current connection
    	 *
    	 * @return DriverInterface
    	 */
    	public function getDriver(): DriverInterface
    	{
    		return $this->connection;
    	}

    	/**
    	 * Convenience public function to generate sql for creating a db table
    	 *
    	 * @param string $name
    	 * @param array $fields
    	 * @param array $constraints
    	 * @param bool $ifNotExists
    	 * @return string
    	 */
    	public function createTable($name, $fields, array $constraints=[], $ifNotExists=TRUE): string
    	{
    		$existsStr = $ifNotExists ? ' IF NOT EXISTS ' : ' ';

    		// Reorganize into an array indexed with column information
    		// Eg $columnArray[$colname] = [
    		// 		'type' => ...,
    		// 		'constraint' => ...,
    		// 		'index' => ...,
    		// ]
    		$columnArray = \arrayZipper([
    			'type' => $fields,
    			'constraint' => $constraints
    		]);

    		// Join column definitions together
    		$columns = [];
    		foreach($columnArray as $n => $props)
    		{
    			$str = $this->getDriver()->quoteIdent($n);
    			$str .= isset($props['type']) ? " {$props['type']}" : '';
    			$str .= isset($props['constraint']) ? " {$props['constraint']}" : '';

    			$columns[] = $str;
    		}

    		// Generate the sql for the creation of the table
    		$sql = 'CREATE TABLE'.$existsStr.$this->getDriver()->quoteTable($name).' (';
    		$sql .= implode(', ', $columns);
    		$sql .= ')';

    		return $sql;
    	}

    	/**
    	 * Drop the selected table
    	 *
    	 * @param string $name
    	 * @return string
    	 */
    	public function deleteTable($name): string
    	{
    		return 'DROP TABLE IF EXISTS '.$this->getDriver()->quoteTable($name);
    	}

    	// --------------------------------------------------------------------------
    	// ! Abstract Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Return an SQL file with the database table structure
    	 *
    	 * @abstract
    	 * @return string
    	 */
    	abstract public function backupStructure(): string;

    	/**
    	 * Return an SQL file with the database data as insert statements
    	 *
    	 * @abstract
    	 * @return string
    	 */
    	abstract public function backupData(): string;

    }
    + Size: 2,904 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Drivers/AbstractUtil.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers;

    /**
     * Abstract class defining database / table creation methods
     */
    abstract class AbstractUtil {

    	/**
    	 * Reference to the current connection object
    	 * @var DriverInterface
    	 */
    	private DriverInterface $connection;

    	/**
    	 * Save a reference to the connection object for later use
    	 *
    	 * @param DriverInterface $connection
    	 */
    	public function __construct(DriverInterface $connection)
    	{
    		$this->connection = $connection;
    	}

    	/**
    	 * Get the driver object for the current connection
    	 *
    	 * @return DriverInterface
    	 */
    	public function getDriver(): DriverInterface
    	{
    		return $this->connection;
    	}

    	/**
    	 * Convenience public function to generate sql for creating a db table
    	 *
    	 * @param string $name
    	 * @param array $fields
    	 * @param array $constraints
    	 * @param bool $ifNotExists
    	 * @return string
    	 */
    	public function createTable($name, $fields, array $constraints=[], $ifNotExists=TRUE): string
    	{
    		$existsStr = $ifNotExists ? ' IF NOT EXISTS ' : ' ';

    		// Reorganize into an array indexed with column information
    		// Eg $columnArray[$colname] = [
    		// 		'type' => ...,
    		// 		'constraint' => ...,
    		// 		'index' => ...,
    		// ]
    		$columnArray = \arrayZipper([
    			'type' => $fields,
    			'constraint' => $constraints
    		]);

    		// Join column definitions together
    		$columns = [];
    		foreach($columnArray as $n => $props)
    		{
    			$str = $this->getDriver()->quoteIdent($n);
    			$str .= isset($props['type']) ? " {$props['type']}" : '';
    			$str .= isset($props['constraint']) ? " {$props['constraint']}" : '';

    			$columns[] = $str;
    		}

    		// Generate the sql for the creation of the table
    		$sql = 'CREATE TABLE'.$existsStr.$this->getDriver()->quoteTable($name).' (';
    		$sql .= implode(', ', $columns);
    		$sql .= ')';

    		return $sql;
    	}

    	/**
    	 * Drop the selected table
    	 *
    	 * @param string $name
    	 * @return string
    	 */
    	public function deleteTable($name): string
    	{
    		return 'DROP TABLE IF EXISTS '.$this->getDriver()->quoteTable($name);
    	}

    	// --------------------------------------------------------------------------
    	// ! Abstract Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Return an SQL file with the database table structure
    	 *
    	 * @abstract
    	 * @return string
    	 */
    	abstract public function backupStructure(): string;

    	/**
    	 * Return an SQL file with the database data as insert statements
    	 *
    	 * @abstract
    	 * @return string
    	 */
    	abstract public function backupData(): string;

    }
    diff --git a/apiDocumentation/source/Drivers/DriverInterface.php.html b/apiDocumentation/source/Drivers/DriverInterface.php.html index f61c3f9..acc0eeb 100644 --- a/apiDocumentation/source/Drivers/DriverInterface.php.html +++ b/apiDocumentation/source/Drivers/DriverInterface.php.html @@ -1,3 +1,3 @@ phpDox - Source of DriverInterface.php

    Source of file DriverInterface.php

    - Size: 6,129 Bytes - Last Modified: 2019-12-11T14:57:29-05:00

    src/Drivers/DriverInterface.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers;

    use InvalidArgumentException;
    use PDO;
    use PDOStatement;

    /**
     * PDO Interface to implement for database drivers
     *
     * @method beginTransaction(): bool
     * @method commit(): bool
     * @method errorCode(): string
     * @method errorInfo(): array
     * @method exec(string $statement): int
     * @method getAttribute(int $attribute)
     * @method inTransaction(): bool
     * @method lastInsertId(string $name = NULL): string
     * @method prepare(string $statement, array $driver_options = []): PDOStatement
     * @method query(string $statement): PDOStatement
     * @method quote(string $string, int $parameter_type = PDO::PARAM_STR): string
     * @method rollback(): bool
     * @method setAttribute(int $attribute, $value): bool
     */
    interface DriverInterface /* extends the interface of PDO */ {

    	/**
    	 * Constructor/Connection method
    	 *
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array $driverOptions
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $driverOptions = []);

    	/**
    	 * Simplifies prepared statements for database queries
    	 *
    	 * @param string $sql
    	 * @param array $data
    	 * @return PDOStatement|null
    	 * @throws InvalidArgumentException
    	 */
    	public function prepareQuery(string $sql, array $data): PDOStatement;

    	/**
    	 * Retrieve column information for the current database table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getColumns(string $table): ?array;

    	/**
    	 * Retrieve list of data types for the database
    	 *
    	 * @return array
    	 */
    	public function getTypes(): ?array;

    	/**
    	 * Retrieve indexes for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getIndexes(string $table): ?array;

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks(string $table): ?array;

    	/**
    	 * Return list of tables for the current database
    	 *
    	 * @return array
    	 */
    	public function getTables(): ?array;

    	/**
    	 * Retrieves an array of non-user-created tables for
    	 * the connection/database
    	 *
    	 * @return array
    	 */
    	public function getSystemTables(): ?array;

    	/**
    	 * Return schemas for databases that list them. Returns
    	 * database list if schemas are databases for the current driver.
    	 *
    	 * @return array
    	 */
    	public function getSchemas(): ?array;

    	/**
    	 * Return list of dbs for the current connection, if possible
    	 *
    	 * @return array
    	 */
    	public function getDbs(): ?array;

    	/**
    	 * Return list of views for the current database
    	 *
    	 * @return array
    	 */
    	public function getViews(): ?array;

    	/**
    	 * Return list of sequences for the current database, if they exist
    	 *
    	 * @return array
    	 */
    	public function getSequences(): ?array;

    	/**
    	 * Return list of functions for the current database
    	 *
    	 * @return array
    	 */
    	public function getFunctions(): ?array;

    	/**
    	 * Return list of stored procedures for the current database
    	 *
    	 * @return array
    	 */
    	public function getProcedures(): ?array;

    	/**
    	 * Return list of triggers for the current database
    	 *
    	 * @return array
    	 */
    	public function getTriggers(): ?array;

    	/**
    	 * Surrounds the string with the databases identifier escape characters
    	 *
    	 * @param string|array $ident
    	 * @return string|array
    	 */
    	public function quoteIdent($ident);

    	/**
    	 * Quote database table name, and set prefix
    	 *
    	 * @param string|array $table
    	 * @return string|array
    	 */
    	public function quoteTable($table);

    	/**
    	 * Create and execute a prepared statement with the provided parameters
    	 *
    	 * @param string $sql
    	 * @param array $params
    	 * @return PDOStatement
    	 */
    	public function prepareExecute(string $sql, array $params): PDOStatement;

    	/**
    	 * Method to simplify retrieving db results for meta-data queries
    	 *
    	 * @param string|array|null $query
    	 * @param bool $filteredIndex
    	 * @return array
    	 */
    	public function driverQuery($query, $filteredIndex=TRUE): ?array;

    	/**
    	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
    	 *
    	 * @return int
    	 */
    	public function affectedRows(): int;

    	/**
    	 * Return the number of rows returned for a SELECT query
    	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
    	 *
    	 * @return int
    	 */
    	public function numRows(): ?int;

    	/**
    	 * Prefixes a table if it is not already prefixed
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function prefixTable(string $table): string;

    	/**
    	 * Create sql for batch insert
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @return array
    	 */
    	public function insertBatch(string $table, array $data=[]): array;

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @param string $where
    	 * @return array
    	 */
    	public function updateBatch(string $table, array $data, string $where): array;

    	/**
    	 * Empty the passed table
    	 *
    	 * @param string $table
    	 * @return PDOStatement
    	 */
    	public function truncate(string $table): PDOStatement;

    	/**
    	 * Get the SQL class for the current driver
    	 *
    	 * @return SQLInterface
    	 */
    	public function getSql(): SQLInterface;

    	/**
    	 * Get the Util class for the current driver
    	 *
    	 * @return AbstractUtil
    	 */
    	public function getUtil(): AbstractUtil;

    	/**
    	 * Get the last sql query executed
    	 *
    	 * @return string
    	 */
    	public function getLastQuery(): string;

    	/**
    	 * Set the last query sql
    	 *
    	 * @param string $queryString
    	 * @return void
    	 */
    	public function setLastQuery(string $queryString): void;

    	/**
    	 * Set the common table name prefix
    	 *
    	 * @param string $prefix
    	 * @return void
    	 */
    	public function setTablePrefix(string $prefix): void;
    }

    + Size: 6,263 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Drivers/DriverInterface.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers;

    use InvalidArgumentException;
    use PDO;
    use PDOStatement;

    /**
     * PDO Interface to implement for database drivers
     *
     * @method beginTransaction(): bool
     * @method commit(): bool
     * @method errorCode(): string
     * @method errorInfo(): array
     * @method exec(string $statement): int
     * @method getAttribute(int $attribute)
     * @method inTransaction(): bool
     * @method lastInsertId(string $name = NULL): string
     * @method prepare(string $statement, array $driver_options = []): PDOStatement
     * @method query(string $statement): PDOStatement
     * @method quote(string $string, int $parameter_type = PDO::PARAM_STR): string
     * @method rollback(): bool
     * @method setAttribute(int $attribute, $value): bool
     */
    interface DriverInterface /* extends the interface of PDO */ {

    	/**
    	 * Constructor/Connection method
    	 *
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array $driverOptions
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $driverOptions = []);

    	/**
    	 * Simplifies prepared statements for database queries
    	 *
    	 * @param string $sql
    	 * @param array $data
    	 * @return PDOStatement|null
    	 * @throws InvalidArgumentException
    	 */
    	public function prepareQuery(string $sql, array $data): PDOStatement;

    	/**
    	 * Retrieve column information for the current database table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getColumns(string $table): ?array;

    	/**
    	 * Retrieve list of data types for the database
    	 *
    	 * @return array
    	 */
    	public function getTypes(): ?array;

    	/**
    	 * Retrieve indexes for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getIndexes(string $table): ?array;

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks(string $table): ?array;

    	/**
    	 * Return list of tables for the current database
    	 *
    	 * @return array
    	 */
    	public function getTables(): ?array;

    	/**
    	 * Retrieves an array of non-user-created tables for
    	 * the connection/database
    	 *
    	 * @return array
    	 */
    	public function getSystemTables(): ?array;

    	/**
    	 * Return schemas for databases that list them. Returns
    	 * database list if schemas are databases for the current driver.
    	 *
    	 * @return array
    	 */
    	public function getSchemas(): ?array;

    	/**
    	 * Return list of dbs for the current connection, if possible
    	 *
    	 * @return array
    	 */
    	public function getDbs(): ?array;

    	/**
    	 * Return list of views for the current database
    	 *
    	 * @return array
    	 */
    	public function getViews(): ?array;

    	/**
    	 * Return list of sequences for the current database, if they exist
    	 *
    	 * @return array
    	 */
    	public function getSequences(): ?array;

    	/**
    	 * Return list of functions for the current database
    	 *
    	 * @return array
    	 */
    	public function getFunctions(): ?array;

    	/**
    	 * Return list of stored procedures for the current database
    	 *
    	 * @return array
    	 */
    	public function getProcedures(): ?array;

    	/**
    	 * Return list of triggers for the current database
    	 *
    	 * @return array
    	 */
    	public function getTriggers(): ?array;

    	/**
    	 * Surrounds the string with the databases identifier escape characters
    	 *
    	 * @param string|array $ident
    	 * @return string|array
    	 */
    	public function quoteIdent($ident);

    	/**
    	 * Quote database table name, and set prefix
    	 *
    	 * @param string|array $table
    	 * @return string|array
    	 */
    	public function quoteTable($table);

    	/**
    	 * Create and execute a prepared statement with the provided parameters
    	 *
    	 * @param string $sql
    	 * @param array $params
    	 * @return PDOStatement
    	 */
    	public function prepareExecute(string $sql, array $params): PDOStatement;

    	/**
    	 * Method to simplify retrieving db results for meta-data queries
    	 *
    	 * @param string|array|null $query
    	 * @param bool $filteredIndex
    	 * @return array
    	 */
    	public function driverQuery($query, $filteredIndex=TRUE): ?array;

    	/**
    	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
    	 *
    	 * @return int
    	 */
    	public function affectedRows(): int;

    	/**
    	 * Return the number of rows returned for a SELECT query
    	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
    	 *
    	 * @return int
    	 */
    	public function numRows(): ?int;

    	/**
    	 * Prefixes a table if it is not already prefixed
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function prefixTable(string $table): string;

    	/**
    	 * Create sql for batch insert
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @return array
    	 */
    	public function insertBatch(string $table, array $data=[]): array;

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @param string $where
    	 * @return array
    	 */
    	public function updateBatch(string $table, array $data, string $where): array;

    	/**
    	 * Empty the passed table
    	 *
    	 * @param string $table
    	 * @return PDOStatement
    	 */
    	public function truncate(string $table): PDOStatement;

    	/**
    	 * Get the SQL class for the current driver
    	 *
    	 * @return SQLInterface
    	 */
    	public function getSql(): SQLInterface;

    	/**
    	 * Get the Util class for the current driver
    	 *
    	 * @return AbstractUtil
    	 */
    	public function getUtil(): AbstractUtil;

    	/**
    	 * Get the version of the database engine
    	 *
    	 * @return string
    	 */
    	public function getVersion(): string;

    	/**
    	 * Get the last sql query executed
    	 *
    	 * @return string
    	 */
    	public function getLastQuery(): string;

    	/**
    	 * Set the last query sql
    	 *
    	 * @param string $queryString
    	 * @return void
    	 */
    	public function setLastQuery(string $queryString): void;

    	/**
    	 * Set the common table name prefix
    	 *
    	 * @param string $prefix
    	 * @return void
    	 */
    	public function setTablePrefix(string $prefix): void;
    }

    diff --git a/apiDocumentation/source/Drivers/Mysql/Driver.php.html b/apiDocumentation/source/Drivers/Mysql/Driver.php.html index d586480..133ec8f 100644 --- a/apiDocumentation/source/Drivers/Mysql/Driver.php.html +++ b/apiDocumentation/source/Drivers/Mysql/Driver.php.html @@ -1,3 +1,3 @@ phpDox - Source of Driver.php

    Source of file Driver.php

    - Size: 1,399 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Drivers/Mysql/Driver.php

    1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Mysql;

    use PDO;
    use Query\Drivers\AbstractDriver;

    /**
     * MySQL specific class
     */
    class Driver extends AbstractDriver {

    	/**
    	 * Set the backtick as the MySQL escape character
    	 *
    	 * @var string
    	 */
    	protected $escapeCharOpen = '`';

    	/**
    	 * Set the backtick as the MySQL escape character
    	 *
    	 * @var string
    	 */
    	protected $escapeCharClose = '`';

    	/**
    	 * Connect to MySQL Database
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array $options
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $options=[])
    	{
    		// Set the charset to UTF-8
    		if (\defined('\\PDO::MYSQL_ATTR_INIT_COMMAND'))
    		{
    			$options = array_merge($options, [
    				PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF-8 COLLATE 'UTF-8'",
    			]);
    		}

    		if (strpos($dsn, 'mysql') === FALSE)
    		{
    			$dsn = 'mysql:'.$dsn;
    		}

    		parent::__construct($dsn, $username, $password, $options);
    	}
    }
    + Size: 2,256 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/Mysql/Driver.php

    12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Mysql;

    use PDO;
    use Query\Drivers\AbstractDriver;
    use function defined;

    /**
     * MySQL specific class
     */
    class Driver extends AbstractDriver {

    	/**
    	 * Set the backtick as the MySQL escape character
    	 *
    	 * @var string
    	 */
    	protected string $escapeCharOpen = '`';

    	/**
    	 * Set the backtick as the MySQL escape character
    	 *
    	 * @var string
    	 */
    	protected string $escapeCharClose = '`';

    	/**
    	 * Connect to MySQL Database
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array $options
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $options=[])
    	{
    		// Set the charset to UTF-8
    		if (defined('\\PDO::MYSQL_ATTR_INIT_COMMAND'))
    		{
    			$options = array_merge($options, [
    				PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF-8 COLLATE 'UTF-8'",
    			]);
    		}

    		if (strpos($dsn, 'mysql') === FALSE)
    		{
    			$dsn = 'mysql:'.$dsn;
    		}

    		parent::__construct($dsn, $username, $password, $options);
    	}

    	/**
    	 * Generate the returning clause for the current database
    	 *
    	 * @param string $query
    	 * @param string $select
    	 * @return string
    	 */
    	public function returning(string $query, string $select): string
    	{
    		// @TODO add checks for MariaDB for future-proofing
    		// MariaDB 10.5.0+ supports the returning clause for insert
    		if (
    			stripos($query, 'insert') !== FALSE
    			&& version_compare($this->getVersion(), '10.5.0', '>=')
    		){
    			return parent::returning($query, $select);
    		}

    		// MariaDB 10.0.5+ supports the returning clause for delete
    		if (
    			stripos($query, 'delete') !== FALSE
    			&& version_compare($this->getVersion(), '10.0.5', '>=')
    		){
    			return parent::returning($query, $select);
    		}

    		// Just return the same SQL if the returning clause is not supported
    		return $query;
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/Mysql/SQL.php.html b/apiDocumentation/source/Drivers/Mysql/SQL.php.html index 4f5c3f8..90deaba 100644 --- a/apiDocumentation/source/Drivers/Mysql/SQL.php.html +++ b/apiDocumentation/source/Drivers/Mysql/SQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQL.php

    Source of file SQL.php

    - Size: 4,055 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Drivers/Mysql/SQL.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Mysql;

    use Query\Drivers\AbstractSQL;

    /**
     * MySQL specific SQL
     */
    class SQL extends AbstractSQL {

    	/**
    	 * Limit clause
    	 *
    	 * @param string $sql
    	 * @param int $limit
    	 * @param int|boolean $offset
    	 * @return string
    	 */
    	public function limit(string $sql, int $limit, $offset=FALSE): string
    	{
    		if ( ! is_numeric($offset))
    		{
    			return $sql." LIMIT {$limit}";
    		}

    		return $sql." LIMIT {$offset}, {$limit}";
    	}

    	/**
    	 * Get the query plan for the sql query
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string
    	{
    		return "EXPLAIN EXTENDED {$sql}";
    	}

    	/**
    	 * Random ordering keyword
    	 *
    	 * @return string
    	 */
    	public function random(): string
    	{
    		return ' RAND() DESC';
    	}

    	/**
    	 * Returns sql to list other databases
    	 *
    	 * @return string
    	 */
    	public function dbList(): string
    	{
    		return <<<SQL
    			SHOW DATABASES WHERE `Database` NOT IN ('information_schema','mysql')
    SQL;

    	}

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @param string $database
    	 * @return string
    	 */
    	public function tableList($database=''): string
    	{
    		// @codeCoverageIgnoreStart
    		if ( ! empty($database))
    		{
    			return "SHOW TABLES FROM `{$database}`";
    		}
    		// @codeCoverageIgnoreEnd

    		return 'SHOW TABLES';
    	}

    	/**
    	 * Overridden in MySQL class
    	 *
    	 * @return string
    	 */
    	public function systemTableList(): string
    	{
    		return <<<SQL
    			SELECT `TABLE_NAME` FROM `information_schema`.`TABLES`
    			WHERE `TABLE_SCHEMA`='information_schema'
    SQL;
    	}

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string
    	{
    		return 'SELECT `table_name` FROM `information_schema`.`views`';
    	}

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): string
    	{
    		return 'SHOW TRIGGERS';
    	}

    	/**
    	 * Return sql to list functions
    	 *
    	 * @return string
    	 */
    	public function functionList(): string
    	{
    		return 'SHOW FUNCTION STATUS';
    	}

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @return string
    	 */
    	public function procedureList(): string
    	{
    		return 'SHOW PROCEDURE STATUS';
    	}

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): ?string
    	{
    		return NULL;
    	}

    	/**
    	 * SQL to show list of field types
    	 *
    	 * @return string
    	 */
    	public function typeList(): string
    	{
    		return 'SELECT DISTINCT `DATA_TYPE` FROM `information_schema`.`COLUMNS`';
    	}

    	/**
    	 * SQL to show infromation about columns in a table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string
    	{
    		return "SHOW FULL COLUMNS FROM {$table}";
    	}

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string
    	{
    		return <<<SQL
    			SELECT DISTINCT 
    				`kcu`.`COLUMN_NAME` as `child_column`,
    				`kcu`.`REFERENCED_TABLE_NAME` as `parent_table`,
    				`kcu`.`REFERENCED_COLUMN_NAME` as `parent_column`,
    				`rc`.`UPDATE_RULE` AS `update`,
    				`rc`.`DELETE_RULE` AS `delete`
    			FROM `INFORMATION_SCHEMA`.`TABLE_CONSTRAINTS` `tc`
    			INNER JOIN `INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` `kcu`
    				ON `kcu`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
    			INNER JOIN `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` `rc`
    				ON `rc`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
    			WHERE `tc`.`CONSTRAINT_TYPE`='FOREIGN KEY'
    			AND `tc`.`TABLE_NAME`='{$table}'
    SQL;
    	}

    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string
    	{
    		return "SHOW INDEX IN {$table}";
    	}
    }
    + Size: 4,076 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/Mysql/SQL.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Mysql;

    use Query\Drivers\AbstractSQL;

    /**
     * MySQL specific SQL
     */
    class SQL extends AbstractSQL {

    	/**
    	 * Limit clause
    	 *
    	 * @param string $sql
    	 * @param int $limit
    	 * @param int|boolean $offset
    	 * @return string
    	 */
    	public function limit(string $sql, int $limit, ?int $offset=NULL): string
    	{
    		if ( ! is_numeric($offset))
    		{
    			return $sql." LIMIT {$limit}";
    		}

    		return $sql." LIMIT {$offset}, {$limit}";
    	}

    	/**
    	 * Get the query plan for the sql query
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string
    	{
    		return "EXPLAIN EXTENDED {$sql}";
    	}

    	/**
    	 * Random ordering keyword
    	 *
    	 * @return string
    	 */
    	public function random(): string
    	{
    		return ' RAND() DESC';
    	}

    	/**
    	 * Returns sql to list other databases
    	 *
    	 * @return string
    	 */
    	public function dbList(): string
    	{
    		return <<<SQL
    			SHOW DATABASES WHERE `Database` NOT IN ('information_schema','mysql')
    SQL;

    	}

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @param string $database
    	 * @return string
    	 */
    	public function tableList($database=''): string
    	{
    		// @codeCoverageIgnoreStart
    		if ( ! empty($database))
    		{
    			return "SHOW TABLES FROM `{$database}`";
    		}
    		// @codeCoverageIgnoreEnd

    		return 'SHOW TABLES';
    	}

    	/**
    	 * Overridden in MySQL class
    	 *
    	 * @return string
    	 */
    	public function systemTableList(): string
    	{
    		return <<<SQL
    			SELECT `TABLE_NAME` FROM `information_schema`.`TABLES`
    			WHERE `TABLE_SCHEMA`='information_schema'
    SQL;
    	}

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string
    	{
    		return 'SELECT `table_name` FROM `information_schema`.`views`';
    	}

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): string
    	{
    		return 'SHOW TRIGGERS';
    	}

    	/**
    	 * Return sql to list functions
    	 *
    	 * @return string
    	 */
    	public function functionList(): string
    	{
    		return 'SHOW FUNCTION STATUS';
    	}

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @return string
    	 */
    	public function procedureList(): string
    	{
    		return 'SHOW PROCEDURE STATUS';
    	}

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): ?string
    	{
    		return NULL;
    	}

    	/**
    	 * SQL to show list of field types
    	 *
    	 * @return string
    	 */
    	public function typeList(): string
    	{
    		return 'SELECT DISTINCT `DATA_TYPE` FROM `information_schema`.`COLUMNS`';
    	}

    	/**
    	 * SQL to show information about columns in a table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string
    	{
    		return "SHOW FULL COLUMNS FROM {$table}";
    	}

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string
    	{
    		return <<<SQL
    			SELECT DISTINCT
    				`kcu`.`COLUMN_NAME` as `child_column`,
    				`kcu`.`REFERENCED_TABLE_NAME` as `parent_table`,
    				`kcu`.`REFERENCED_COLUMN_NAME` as `parent_column`,
    				`rc`.`UPDATE_RULE` AS `update`,
    				`rc`.`DELETE_RULE` AS `delete`
    			FROM `INFORMATION_SCHEMA`.`TABLE_CONSTRAINTS` `tc`
    			INNER JOIN `INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` `kcu`
    				ON `kcu`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
    			INNER JOIN `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` `rc`
    				ON `rc`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
    			WHERE `tc`.`CONSTRAINT_TYPE`='FOREIGN KEY'
    			AND `tc`.`TABLE_NAME`='{$table}'
    SQL;
    	}

    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string
    	{
    		return "SHOW INDEX IN {$table}";
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/Mysql/Util.php.html b/apiDocumentation/source/Drivers/Mysql/Util.php.html index ad5256c..77edcbe 100644 --- a/apiDocumentation/source/Drivers/Mysql/Util.php.html +++ b/apiDocumentation/source/Drivers/Mysql/Util.php.html @@ -1,3 +1,3 @@ phpDox - Source of Util.php

    Source of file Util.php

    - Size: 2,627 Bytes - Last Modified: 2019-12-11T13:58:40-05:00

    src/Drivers/Mysql/Util.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Mysql;

    use PDO;
    use Query\Drivers\AbstractUtil;

    /**
     * MySQL-specific backup, import and creation methods
     */
    class Util extends AbstractUtil {

    	/**
    	 * Create an SQL backup file for the current database's structure
    	 *
    	 * @return string
    	 */
    	public function backupStructure(): string
    	{
    		$string = [];

    		// Get databases
    		$dbs = $this->getDriver()->getDbs();

    		foreach($dbs as &$d)
    		{
    			// Skip built-in dbs
    			// @codeCoverageIgnoreStart
    			if ($d === 'mysql')
    			{
    				continue;
    			}
    			// @codeCoverageIgnoreEnd

    			// Get the list of tables
    			$tables = $this->getDriver()->driverQuery("SHOW TABLES FROM `{$d}`", TRUE);

    			foreach($tables as $table)
    			{
    				$array = $this->getDriver()->driverQuery("SHOW CREATE TABLE `{$d}`.`{$table}`", FALSE);
    				$row = current($array);

    				if ( ! isset($row['Create Table']))
    				{
    					continue;
    				}


    				$string[] = $row['Create Table'];
    			}
    		}

    		return implode("\n\n", $string);
    	}

    	/**
    	 * Create an SQL backup file for the current database's data
    	 *
    	 * @param array $exclude
    	 * @return string
    	 */
    	public function backupData($exclude=[]): string
    	{
    		$tables = $this->getDriver()->getTables();

    		// Filter out the tables you don't want
    		if( ! empty($exclude))
    		{
    			$tables = array_diff($tables, $exclude);
    		}

    		$outputSql = '';

    		// Select the rows from each Table
    		foreach($tables as $t)
    		{
    			$sql = "SELECT * FROM `{$t}`";
    			$res = $this->getDriver()->query($sql);
    			$rows = $res->fetchAll(PDO::FETCH_ASSOC);

    			// Skip empty tables
    			if (count($rows) < 1)
    			{
    				continue;
    			}

    			// Nab the column names by getting the keys of the first row
    			$columns = @array_keys($rows[0]);

    			$insertRows = [];

    			// Create the insert statements
    			foreach($rows as $row)
    			{
    				$row = array_values($row);

    				// Workaround for Quercus
    				foreach($row as &$r)
    				{
    					$r = $this->getDriver()->quote($r);
    				}
    				unset($r);
    				$row = array_map('trim', $row);

    				$rowString = 'INSERT INTO `'.trim($t).'` (`'.implode('`,`', $columns).'`) VALUES ('.implode(',', $row).');';

    				$row = NULL;

    				$insertRows[] = $rowString;
    			}

    			$outputSql .= "\n\n".implode("\n", $insertRows)."\n";
    		}

    		return $outputSql;
    	}
    }
    + Size: 2,649 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/Mysql/Util.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Mysql;

    use PDO;
    use Query\Drivers\AbstractUtil;

    /**
     * MySQL-specific backup, import and creation methods
     */
    class Util extends AbstractUtil {

    	/**
    	 * Create an SQL backup file for the current database's structure
    	 *
    	 * @return string
    	 */
    	public function backupStructure(): string
    	{
    		$string = [];

    		// Get databases
    		$driver = $this->getDriver();
    		$dbs = $driver->getDbs();

    		foreach($dbs as &$d)
    		{
    			// Skip built-in dbs
    			// @codeCoverageIgnoreStart
    			if ($d === 'mysql')
    			{
    				continue;
    			}
    			// @codeCoverageIgnoreEnd

    			// Get the list of tables
    			$tables = $driver->driverQuery("SHOW TABLES FROM `{$d}`", TRUE);

    			foreach($tables as $table)
    			{
    				$array = $driver->driverQuery("SHOW CREATE TABLE `{$d}`.`{$table}`", FALSE);
    				$row = current($array);

    				if ( ! isset($row['Create Table']))
    				{
    					continue;
    				}


    				$string[] = $row['Create Table'];
    			}
    		}

    		return implode("\n\n", $string);
    	}

    	/**
    	 * Create an SQL backup file for the current database's data
    	 *
    	 * @param array $exclude
    	 * @return string
    	 */
    	public function backupData(array $exclude=[]): string
    	{
    		$driver = $this->getDriver();
    		$tables = $driver->getTables();

    		// Filter out the tables you don't want
    		if( ! empty($exclude))
    		{
    			$tables = array_diff($tables, $exclude);
    		}

    		$outputSql = '';

    		// Select the rows from each Table
    		foreach($tables as $t)
    		{
    			$sql = "SELECT * FROM `{$t}`";
    			$res = $driver->query($sql);
    			$rows = $res->fetchAll(PDO::FETCH_ASSOC);

    			// Skip empty tables
    			if (count($rows) < 1)
    			{
    				continue;
    			}

    			// Nab the column names by getting the keys of the first row
    			$columns = @array_keys($rows[0]);

    			$insertRows = [];

    			// Create the insert statements
    			foreach($rows as $row)
    			{
    				$row = array_values($row);

    				// Workaround for Quercus
    				foreach($row as &$r)
    				{
    					$r = $driver->quote($r);
    				}
    				unset($r);
    				$row = array_map('trim', $row);

    				$rowString = 'INSERT INTO `'.trim($t).'` (`'.implode('`,`', $columns).'`) VALUES ('.implode(',', $row).');';

    				$row = NULL;

    				$insertRows[] = $rowString;
    			}

    			$outputSql .= "\n\n".implode("\n", $insertRows)."\n";
    		}

    		return $outputSql;
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/Pgsql/Driver.php.html b/apiDocumentation/source/Drivers/Pgsql/Driver.php.html index 49bb3a3..d94bef2 100644 --- a/apiDocumentation/source/Drivers/Pgsql/Driver.php.html +++ b/apiDocumentation/source/Drivers/Pgsql/Driver.php.html @@ -1,3 +1,3 @@ phpDox - Source of Driver.php

    Source of file Driver.php

    - Size: 1,741 Bytes - Last Modified: 2019-12-11T13:47:53-05:00

    src/Drivers/Pgsql/Driver.php

    1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Pgsql;

    use Query\Drivers\AbstractDriver;

    /**
     * PostgreSQL specific class
     */
    class Driver extends AbstractDriver {

    	/**
    	 * Connect to a PosgreSQL database
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array  $options
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $options=[])
    	{
    		if (strpos($dsn, 'pgsql') === FALSE)
    		{
    			$dsn = 'pgsql:'.$dsn;
    		}

    		parent::__construct($dsn, $username, $password, $options);
    	}

    	/**
    	 * Get a list of schemas for the current connection
    	 *
    	 * @return array
    	 */
    	public function getSchemas(): ?array
    	{
    		$sql = <<<SQL
    			SELECT DISTINCT "schemaname" FROM "pg_tables"
    			WHERE "schemaname" NOT LIKE 'pg\_%'
    			AND "schemaname" != 'information_schema'
    SQL;

    		return $this->driverQuery($sql);
    	}

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks($table): array
    	{
    		$valueMap = [
    			'c' => 'CASCADE',
    			'r' => 'RESTRICT',
    		];

    		$keys = parent::getFks($table);

    		foreach($keys as &$key)
    		{
    			foreach(['update', 'delete'] AS $type)
    			{
    				if ( ! isset($valueMap[$key[$type]]))
    				{
    					continue;
    				}

    				$key[$type] = $valueMap[$key[$type]];
    			}
    		}

    		return $keys;
    	}
    }
    + Size: 1,823 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Drivers/Pgsql/Driver.php

    1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Pgsql;

    use Query\Drivers\AbstractDriver;

    /**
     * PostgreSQL specific class
     */
    class Driver extends AbstractDriver {

    	/**
    	 * Connect to a PosgreSQL database
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $dsn
    	 * @param string $username
    	 * @param string $password
    	 * @param array  $options
    	 */
    	public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $options=[])
    	{
    		if (strpos($dsn, 'pgsql') === FALSE)
    		{
    			$dsn = 'pgsql:'.$dsn;
    		}

    		parent::__construct($dsn, $username, $password, $options);
    	}

    	/**
    	 * Get a list of schemas for the current connection
    	 *
    	 * @return array
    	 */
    	public function getSchemas(): ?array
    	{
    		$sql = <<<SQL
    			SELECT DISTINCT "schemaname" FROM "pg_tables"
    			WHERE "schemaname" NOT LIKE 'pg\_%'
    			AND "schemaname" != 'information_schema'
    SQL;

    		return $this->driverQuery($sql);
    	}

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks($table): array
    	{
    		$valueMap = [
    			'c' => 'CASCADE',
    			'r' => 'RESTRICT',
    		];

    		$keys = parent::getFks($table);

    		foreach($keys as &$key)
    		{
    			foreach(['update', 'delete'] AS $type)
    			{
    				if ( ! isset($valueMap[$key[$type]]))
    				{
    					// @codeCoverageIgnoreStart
    					continue;
    					// @codeCoverageIgnoreEnd
    				}

    				$key[$type] = $valueMap[$key[$type]];
    			}
    		}

    		return $keys;
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/Pgsql/SQL.php.html b/apiDocumentation/source/Drivers/Pgsql/SQL.php.html index 7a3d047..d6b3472 100644 --- a/apiDocumentation/source/Drivers/Pgsql/SQL.php.html +++ b/apiDocumentation/source/Drivers/Pgsql/SQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQL.php

    Source of file SQL.php

    - Size: 5,455 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Drivers/Pgsql/SQL.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Pgsql;

    use Query\Drivers\AbstractSQL;

    /**
     * PostgreSQL specific SQL
     */
    class SQL extends AbstractSQL {

    	/**
    	 * Get the query plan for the sql query
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string
    	{
    		return "EXPLAIN VERBOSE {$sql}";
    	}

    	/**
    	 * Random ordering keyword
    	 *
    	 * @return string
    	 */
    	public function random(): string
    	{
    		return ' RANDOM()';
    	}

    	/**
    	 * Returns sql to list other databases
    	 *
    	 * @return string
    	 */
    	public function dbList(): string
    	{
    		return <<<SQL
    			SELECT "datname" FROM "pg_database"
    			WHERE "datname" NOT IN ('template0','template1')
    			ORDER BY "datname" ASC
    SQL;
    	}

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @return string
    	 */
    	public function tableList(): string
    	{
    		return <<<SQL
    			SELECT "table_name"
    			FROM "information_schema"."tables"
    			WHERE "table_type" = 'BASE TABLE'
    			AND "table_schema" NOT IN
    				('pg_catalog', 'information_schema');
    SQL;
    	}

    	/**
    	 * Returns sql to list system tables
    	 *
    	 * @return string
    	 */
    	public function systemTableList(): string
    	{
    		return <<<SQL
    			SELECT "table_name"
    			FROM "information_schema"."tables"
    			WHERE "table_type" = 'BASE TABLE'
    			AND "table_schema" IN
    				('pg_catalog', 'information_schema');
    SQL;
    	}

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string
    	{
    		return <<<SQL
    		 	SELECT "viewname" FROM "pg_views"
    			WHERE "schemaname" NOT IN
    				('pg_catalog', 'information_schema')
    			AND "viewname" !~ '^pg_'
    			ORDER BY "viewname" ASC
    SQL;
    	}

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): string
    	{
    		return <<<SQL
    			SELECT *
    			FROM "information_schema"."triggers"
    			WHERE "trigger_schema" NOT IN
    				('pg_catalog', 'information_schema')
    SQL;
    	}

    	/**
    	 * Return sql to list functions
    	 *
    	 * @return string
    	 */
    	public function functionList(): ?string
    	{
    		return NULL;
    	}

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @return string
    	 */
    	public function procedureList(): string
    	{
    		return <<<SQL
    			SELECT "routine_name"
    			FROM "information_schema"."routines"
    			WHERE "specific_schema" NOT IN
    				('pg_catalog', 'information_schema')
    			AND "type_udt_name" != 'trigger';
    SQL;
    	}

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): string
    	{
    		return <<<SQL
    			SELECT "c"."relname"
    			FROM "pg_class" "c"
    			WHERE "c"."relkind" = 'S'
    			ORDER BY "relname" ASC
    SQL;
    	}

    	/**
    	 * Return sql to list columns of the specified table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string
    	{
    		return <<<SQL
    			SELECT ordinal_position,
    				column_name,
    				data_type,
    				column_default,
    				is_nullable,
    				character_maximum_length,
    				numeric_precision
    			FROM information_schema.columns
    			WHERE table_name = '{$table}'
    			ORDER BY ordinal_position;
    SQL;
    	}

    	/**
    	 * SQL to show list of field types
    	 *
    	 * @return string
    	 */
    	public function typeList(): string
    	{
    		return <<<SQL
    			SELECT "typname" FROM "pg_catalog"."pg_type"
    			WHERE "typname" !~ '^pg_|_'
    			AND "typtype" = 'b'
    			ORDER BY "typname"
    SQL;
    	}

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string
    	{
    		return <<<SQL
    			SELECT
    				"att2"."attname" AS "child_column",
    				"cl"."relname" AS "parent_table",
    				"att"."attname" AS "parent_column",
    				"con"."update" AS "update",
    				"con"."update" AS "delete"
    			FROM
    				(SELECT
    					unnest(con1.conkey) AS "parent",
    					unnest(con1.confkey) AS "child",
    					"con1"."confrelid",
    					"con1"."conrelid",
    					"con1"."confupdtype" as "update",
    					"con1"."confdeltype" as "delete"
    				FROM "pg_class" "cl"
    				JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid"
    				JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid"
    				WHERE "cl"."relname" = '{$table}'
    					AND "ns"."nspname" = 'public'
    					AND "con1"."contype" = 'f'
    				)
    				"con"
    				JOIN "pg_attribute" "att" ON
    					"att"."attrelid" = "con"."confrelid"
    					AND "att"."attnum" = "con"."child"
    				JOIN "pg_class" "cl" ON
    					"cl"."oid" = "con"."confrelid"
    				JOIN "pg_attribute" "att2" ON
    					"att2"."attrelid" = "con"."conrelid"
    					AND "att2"."attnum" = "con"."parent"
    SQL;
    	}

    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string
    	{
    		return <<<SQL
    			SELECT
    				t.relname AS table_name,
    				i.relname AS index_name,
    				array_to_string(array_agg(a.attname), ', ') AS column_names
    			FROM
    				pg_class t,
    				pg_class i,
    				pg_index ix,
    				pg_attribute a
    			WHERE
    				t.oid = ix.indrelid
    				AND i.oid = ix.indexrelid
    				AND a.attrelid = t.oid
    				AND a.attnum = ANY(ix.indkey)
    				AND t.relkind = 'r'
    				AND t.relname = '{$table}'
    			GROUP BY
    				t.relname,
    				i.relname
    			ORDER BY
    				t.relname,
    				i.relname;
    SQL;
    	}
    }
    + Size: 5,473 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Drivers/Pgsql/SQL.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Pgsql;

    use Query\Drivers\AbstractSQL;

    /**
     * PostgreSQL specific SQL
     */
    class SQL extends AbstractSQL {

    	/**
    	 * Get the query plan for the sql query
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string
    	{
    		return "EXPLAIN VERBOSE {$sql}";
    	}

    	/**
    	 * Random ordering keyword
    	 *
    	 * @return string
    	 */
    	public function random(): string
    	{
    		return ' RANDOM()';
    	}

    	/**
    	 * Returns sql to list other databases
    	 *
    	 * @return string
    	 */
    	public function dbList(): string
    	{
    		return <<<SQL
    			SELECT "datname" FROM "pg_database"
    			WHERE "datname" NOT IN ('template0','template1')
    			ORDER BY "datname" ASC
    SQL;
    	}

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @return string
    	 */
    	public function tableList(): string
    	{
    		return <<<SQL
    			SELECT "table_name"
    			FROM "information_schema"."tables"
    			WHERE "table_type" = 'BASE TABLE'
    			AND "table_schema" NOT IN
    				('pg_catalog', 'information_schema');
    SQL;
    	}

    	/**
    	 * Returns sql to list system tables
    	 *
    	 * @return string
    	 */
    	public function systemTableList(): string
    	{
    		return <<<SQL
    			SELECT "table_name"
    			FROM "information_schema"."tables"
    			WHERE "table_type" = 'BASE TABLE'
    			AND "table_schema" IN
    				('pg_catalog', 'information_schema');
    SQL;
    	}

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string
    	{
    		return <<<SQL
    		 	SELECT "viewname" FROM "pg_views"
    			WHERE "schemaname" NOT IN
    				('pg_catalog', 'information_schema')
    			AND "viewname" !~ '^pg_'
    			ORDER BY "viewname" ASC
    SQL;
    	}

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): string
    	{
    		return <<<SQL
    			SELECT *
    			FROM "information_schema"."triggers"
    			WHERE "trigger_schema" NOT IN
    				('pg_catalog', 'information_schema')
    SQL;
    	}

    	/**
    	 * Return sql to list functions
    	 *
    	 * @return string
    	 */
    	public function functionList(): ?string
    	{
    		return NULL;
    	}

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @return string
    	 */
    	public function procedureList(): string
    	{
    		return <<<SQL
    			SELECT "routine_name"
    			FROM "information_schema"."routines"
    			WHERE "specific_schema" NOT IN
    				('pg_catalog', 'information_schema')
    			AND "type_udt_name" != 'trigger';
    SQL;
    	}

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): string
    	{
    		return <<<SQL
    			SELECT "c"."relname"
    			FROM "pg_class" "c"
    			WHERE "c"."relkind" = 'S'
    			ORDER BY "relname" ASC
    SQL;
    	}

    	/**
    	 * Return sql to list columns of the specified table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string
    	{
    		return <<<SQL
    			SELECT ordinal_position,
    				column_name,
    				data_type,
    				column_default,
    				is_nullable,
    				character_maximum_length,
    				numeric_precision
    			FROM information_schema.columns
    			WHERE table_name = '{$table}'
    			ORDER BY ordinal_position;
    SQL;
    	}

    	/**
    	 * SQL to show list of field types
    	 *
    	 * @return string
    	 */
    	public function typeList(): string
    	{
    		return <<<SQL
    			SELECT "typname" FROM "pg_catalog"."pg_type"
    			WHERE "typname" !~ '^pg_|_'
    			AND "typtype" = 'b'
    			ORDER BY "typname"
    SQL;
    	}

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string
    	{
    		return <<<SQL
    			SELECT
    				"att2"."attname" AS "child_column",
    				"cl"."relname" AS "parent_table",
    				"att"."attname" AS "parent_column",
    				"con"."update" AS "update",
    				"con"."update" AS "delete"
    			FROM
    				(SELECT
    					unnest(con1.conkey) AS "parent",
    					unnest(con1.confkey) AS "child",
    					"con1"."confrelid",
    					"con1"."conrelid",
    					"con1"."confupdtype" as "update",
    					"con1"."confdeltype" as "delete"
    				FROM "pg_class" "cl"
    				JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid"
    				JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid"
    				WHERE "cl"."relname" = '{$table}'
    					AND "ns"."nspname" = 'public'
    					AND "con1"."contype" = 'f'
    				)
    				"con"
    				JOIN "pg_attribute" "att" ON
    					"att"."attrelid" = "con"."confrelid"
    					AND "att"."attnum" = "con"."child"
    				JOIN "pg_class" "cl" ON
    					"cl"."oid" = "con"."confrelid"
    				JOIN "pg_attribute" "att2" ON
    					"att2"."attrelid" = "con"."conrelid"
    					AND "att2"."attnum" = "con"."parent"
    SQL;
    	}

    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string
    	{
    		return <<<SQL
    			SELECT
    				t.relname AS table_name,
    				i.relname AS index_name,
    				array_to_string(array_agg(a.attname), ', ') AS column_names
    			FROM
    				pg_class t,
    				pg_class i,
    				pg_index ix,
    				pg_attribute a
    			WHERE
    				t.oid = ix.indrelid
    				AND i.oid = ix.indexrelid
    				AND a.attrelid = t.oid
    				AND a.attnum = ANY(ix.indkey)
    				AND t.relkind = 'r'
    				AND t.relname = '{$table}'
    			GROUP BY
    				t.relname,
    				i.relname
    			ORDER BY
    				t.relname,
    				i.relname;
    SQL;
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/Pgsql/Util.php.html b/apiDocumentation/source/Drivers/Pgsql/Util.php.html index dd90fbb..60c09c5 100644 --- a/apiDocumentation/source/Drivers/Pgsql/Util.php.html +++ b/apiDocumentation/source/Drivers/Pgsql/Util.php.html @@ -1,3 +1,3 @@ phpDox - Source of Util.php

    Source of file Util.php

    - Size: 2,077 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Drivers/Pgsql/Util.php

    12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Pgsql;

    use Query\Drivers\AbstractUtil;

    /**
     * Postgres-specific backup, import and creation methods
     */
    class Util extends AbstractUtil {

    	/**
    	 * Create an SQL backup file for the current database's structure
    	 *
    	 * @return string
    	 */
    	public function backupStructure(): string
    	{
    		// @TODO Implement Backup function
    		return '';
    	}

    	/**
    	 * Create an SQL backup file for the current database's data
    	 *
    	 * @param array $exclude
    	 * @return string
    	 */
    	public function backupData(array $exclude=[]): string
    	{
    		$tables = $this->getDriver()->getTables();

    		// Filter out the tables you don't want
    		if( ! empty($exclude))
    		{
    			$tables = array_diff($tables, $exclude);
    		}

    		$outputSql = '';

    		// Get the data for each object
    		foreach($tables as $t)
    		{
    			$sql = 'SELECT * FROM "'.trim($t).'"';
    			$res = $this->getDriver()->query($sql);
    			$objRes = $res->fetchAll(\PDO::FETCH_ASSOC);

    			// Don't add to the file if the table is empty
    			if (count($objRes) < 1)
    			{
    				continue;
    			}

    			$res = NULL;

    			// Nab the column names by getting the keys of the first row
    			$columns = @array_keys($objRes[0]);

    			$insertRows = [];

    			// Create the insert statements
    			foreach($objRes as $row)
    			{
    				$row = array_values($row);

    				// Quote values as needed by type
    				$row = array_map([$this->getDriver(), 'quote'], $row);
    				$row = array_map('trim', $row);


    				$rowString = 'INSERT INTO "'.trim($t).'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

    				$row = NULL;

    				$insertRows[] = $rowString;
    			}

    			$objRes = NULL;

    			$outputSql .= "\n\n".implode("\n", $insertRows)."\n";
    		}

    		return $outputSql;
    	}
    }
    + Size: 2,103 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/Pgsql/Util.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Pgsql;

    use PDO;
    use Query\Drivers\AbstractUtil;

    /**
     * Postgres-specific backup, import and creation methods
     */
    class Util extends AbstractUtil {

    	/**
    	 * Create an SQL backup file for the current database's structure
    	 *
    	 * @return string
    	 */
    	public function backupStructure(): string
    	{
    		// @TODO Implement Backup function
    		return '';
    	}

    	/**
    	 * Create an SQL backup file for the current database's data
    	 *
    	 * @param array $exclude
    	 * @return string
    	 */
    	public function backupData(array $exclude=[]): string
    	{
    		$tables = $this->getDriver()->getTables();

    		// Filter out the tables you don't want
    		if( ! empty($exclude))
    		{
    			$tables = array_diff($tables, $exclude);
    		}

    		$outputSql = '';

    		// Get the data for each object
    		foreach($tables as $t)
    		{
    			$sql = 'SELECT * FROM "'.trim($t).'"';
    			$res = $this->getDriver()->query($sql);
    			$objRes = $res->fetchAll(PDO::FETCH_ASSOC);

    			// Don't add to the file if the table is empty
    			if (count($objRes) < 1)
    			{
    				continue;
    			}

    			$res = NULL;

    			// Nab the column names by getting the keys of the first row
    			$columns = @array_keys($objRes[0]);

    			$insertRows = [];

    			// Create the insert statements
    			foreach($objRes as $row)
    			{
    				$row = array_values($row);

    				// Quote values as needed by type
    				$row = array_map([$this->getDriver(), 'quote'], $row);
    				$row = array_map('trim', $row);


    				$rowString = 'INSERT INTO "'.trim($t).'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

    				$row = NULL;

    				$insertRows[] = $rowString;
    			}

    			$objRes = NULL;

    			$outputSql .= "\n\n".implode("\n", $insertRows)."\n";
    		}

    		return $outputSql;
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/SQLInterface.php.html b/apiDocumentation/source/Drivers/SQLInterface.php.html index 5091452..c06947d 100644 --- a/apiDocumentation/source/Drivers/SQLInterface.php.html +++ b/apiDocumentation/source/Drivers/SQLInterface.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQLInterface.php

    Source of file SQLInterface.php

    - Size: 2,470 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Drivers/SQLInterface.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers;

    /**
     * Interface for database-specific syntax subclasses
     */
    interface SQLInterface {

    	/**
    	 * Get database specific sql for limit clause
    	 *
    	 * @param string $sql
    	 * @param int $limit
    	 * @param int|bool $offset
    	 * @return string
    	 */
    	public function limit(string $sql, int $limit, $offset=FALSE): string;

    	/**
    	 * Modify the query to get the query plan
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string;

    	/**
    	 * Get the sql for random ordering
    	 *
    	 * @return string
    	 */
    	public function random(): string;

    	/**
    	 * Returns sql to list other databases
    	 *
    	 * @return string
    	 */
    	public function dbList(): string;

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @return string
    	 */
    	public function tableList(): string;

    	/**
    	 * Returns sql to list system tables
    	 *
    	 * @return string|array
    	 */
    	public function systemTableList();

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string;

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): ?string;

    	/**
    	 * Return sql to list functions
    	 *
    	 * @return string
    	 */
    	public function functionList(): ?string;

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @return string
    	 */
    	public function procedureList(): ?string;

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): ?string;

    	/**
    	 * Return sql to list database field types
    	 *
    	 * @return string|array
    	 */
    	public function typeList();

    	/**
    	 * Get information about the columns in the
    	 * specified table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string;

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string;

    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string;
    }
    + Size: 2,492 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/SQLInterface.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers;

    /**
     * Interface for database-specific syntax subclasses
     */
    interface SQLInterface {

    	/**
    	 * Get database specific sql for limit clause
    	 *
    	 * @param string $sql
    	 * @param int $limit
    	 * @param int|null $offset
    	 * @return string
    	 */
    	public function limit(string $sql, int $limit, ?int $offset=NULL): string;

    	/**
    	 * Modify the query to get the query plan
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string;

    	/**
    	 * Get the sql for random ordering
    	 *
    	 * @return string
    	 */
    	public function random(): string;

    	/**
    	 * Returns sql to list other databases
    	 *
    	 * @return string
    	 */
    	public function dbList(): string;

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @return string
    	 */
    	public function tableList(): string;

    	/**
    	 * Returns sql to list system tables
    	 *
    	 * @return string|array
    	 */
    	public function systemTableList();

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string;

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): ?string;

    	/**
    	 * Return sql to list functions
    	 *
    	 * @return string
    	 */
    	public function functionList(): ?string;

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @return string
    	 */
    	public function procedureList(): ?string;

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): ?string;

    	/**
    	 * Return sql to list database field types
    	 *
    	 * @return string|array
    	 */
    	public function typeList();

    	/**
    	 * Get information about the columns in the
    	 * specified table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string;

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string;

    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string;
    }
    diff --git a/apiDocumentation/source/Drivers/Sqlite/Driver.php.html b/apiDocumentation/source/Drivers/Sqlite/Driver.php.html index 2a9c73e..be187d5 100644 --- a/apiDocumentation/source/Drivers/Sqlite/Driver.php.html +++ b/apiDocumentation/source/Drivers/Sqlite/Driver.php.html @@ -1,3 +1,3 @@ phpDox - Source of Driver.php

    Source of file Driver.php

    - Size: 3,373 Bytes - Last Modified: 2019-12-11T14:08:34-05:00

    src/Drivers/Sqlite/Driver.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Sqlite;

    use function is_array;

    use InvalidArgumentException;
    use PDO;
    use Query\Drivers\AbstractDriver;

    /**
     * SQLite specific class
     */
    class Driver extends AbstractDriver {

    	/**
    	 * SQLite has a truncate optimization,
    	 * but no support for the actual keyword
    	 * @var boolean
    	 */
    	protected $hasTruncate = FALSE;

    	/**
    	 * Open SQLite Database
    	 *
    	 * @param string $dsn
    	 * @param string $user
    	 * @param string $pass
    	 * @param array $driverOptions
    	 */
    	public function __construct(string $dsn, string $user=NULL, string $pass=NULL, array $driverOptions=[])
    	{
    		if (strpos($dsn, 'sqlite:') === FALSE)
    		{
    			$dsn = "sqlite:{$dsn}";
    		}

    		parent::__construct($dsn, $user, $pass);
    	}

    	/**
    	 * Return list of dbs for the current connection, if possible. Meaningless for SQLite.
    	 *
    	 * @return array | null
    	 */
    	public function getDbs(): ?array
    	{
    		return NULL;
    	}

    	/**
    	 * List tables for the current database
    	 *
    	 * @return mixed
    	 */
    	public function getTables(): array
    	{
    		$sql = $this->sql->tableList();
    		$res = $this->query($sql);
    		return dbFilter($res->fetchAll(PDO::FETCH_ASSOC), 'name');
    	}

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks($table): array
    	{
    		$returnRows = [];

    		foreach(parent::getFks($table) as $row)
    		{
    			$returnRows[] = [
    				'child_column' => $row['from'],
    				'parent_table' => $row['table'],
    				'parent_column' => $row['to'],
    				'update' => $row['on_update'],
    				'delete' => $row['on_delete']
    			];
    		}

    		return $returnRows;
    	}

    	/**
    	 * Create sql for batch insert
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $table
    	 * @param array $data
    	 * @return array
    	 */
    	public function insertBatch(string $table, array $data=[]): array
    	{
    		// If greater than version 3.7.11, supports the same syntax as
    		// MySQL and Postgres
    		if (version_compare($this->getAttribute(PDO::ATTR_SERVER_VERSION), '3.7.11', '>='))
    		{
    			return parent::insertBatch($table, $data);
    		}

    		// --------------------------------------------------------------------------
    		// Otherwise, do a union query as an analogue to a 'proper' batch insert
    		// --------------------------------------------------------------------------

    		// Each member of the data array needs to be an array
    		if ( ! is_array(current($data)))
    		{
    			throw new InvalidArgumentException('$data must be an array of arrays');
    		}

    		// Start the block of sql statements
    		$table = $this->quoteTable($table);
    		$sql = "INSERT INTO {$table} \n";

    		// Create a key-value mapping for each field
    		$first = array_shift($data);
    		$cols = [];
    		foreach($first as $colName => $datum)
    		{
    			$cols[] = $this->_quote($datum) . ' AS ' . $this->quoteIdent($colName);
    		}
    		$sql .= 'SELECT ' . implode(', ', $cols) . "\n";

    		foreach($data as $union)
    		{
    			$vals = array_map([$this, 'quote'], $union);
    			$sql .= 'UNION SELECT ' . implode(',', $vals) . "\n";
    		}

    		return [$sql, NULL];
    	}
    }
    + Size: 3,677 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/Sqlite/Driver.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Sqlite;

    use function is_array;

    use InvalidArgumentException;
    use PDO;
    use Query\Drivers\AbstractDriver;

    /**
     * SQLite specific class
     */
    class Driver extends AbstractDriver {

    	/**
    	 * SQLite has a truncate optimization,
    	 * but no support for the actual keyword
    	 * @var boolean
    	 */
    	protected bool $hasTruncate = FALSE;

    	/**
    	 * Open SQLite Database
    	 *
    	 * @param string $dsn
    	 * @param string $user
    	 * @param string $pass
    	 * @param array $driverOptions
    	 */
    	public function __construct(string $dsn, string $user=NULL, string $pass=NULL, array $driverOptions=[])
    	{
    		if (strpos($dsn, 'sqlite:') === FALSE)
    		{
    			$dsn = "sqlite:{$dsn}";
    		}

    		parent::__construct($dsn, $user, $pass);
    	}

    	/**
    	 * Return list of dbs for the current connection, if possible. Meaningless for SQLite.
    	 *
    	 * @return array | null
    	 */
    	public function getDbs(): ?array
    	{
    		return NULL;
    	}

    	/**
    	 * List tables for the current database
    	 *
    	 * @return mixed
    	 */
    	public function getTables(): array
    	{
    		$sql = $this->getSql()->tableList();
    		$res = $this->query($sql);
    		return dbFilter($res->fetchAll(PDO::FETCH_ASSOC), 'name');
    	}

    	/**
    	 * Retrieve foreign keys for the table
    	 *
    	 * @param string $table
    	 * @return array
    	 */
    	public function getFks($table): array
    	{
    		$returnRows = [];

    		foreach(parent::getFks($table) as $row)
    		{
    			$returnRows[] = [
    				'child_column' => $row['from'],
    				'parent_table' => $row['table'],
    				'parent_column' => $row['to'],
    				'update' => $row['on_update'],
    				'delete' => $row['on_delete']
    			];
    		}

    		return $returnRows;
    	}

    	/**
    	 * Create sql for batch insert
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $table
    	 * @param array $data
    	 * @return array
    	 */
    	public function insertBatch(string $table, array $data=[]): array
    	{
    		// If greater than version 3.7.11, supports the same syntax as
    		// MySQL and Postgres
    		if (version_compare($this->getVersion(), '3.7.11', '>='))
    		{
    			return parent::insertBatch($table, $data);
    		}

    		// --------------------------------------------------------------------------
    		// Otherwise, do a union query as an analogue to a 'proper' batch insert
    		// --------------------------------------------------------------------------

    		// Each member of the data array needs to be an array
    		if ( ! is_array(current($data)))
    		{
    			throw new InvalidArgumentException('$data must be an array of arrays');
    		}

    		// Start the block of sql statements
    		$table = $this->quoteTable($table);
    		$sql = "INSERT INTO {$table} \n";

    		// Create a key-value mapping for each field
    		$first = array_shift($data);
    		$cols = [];
    		foreach($first as $colName => $datum)
    		{
    			$cols[] = $this->_quote($datum) . ' AS ' . $this->quoteIdent($colName);
    		}
    		$sql .= 'SELECT ' . implode(', ', $cols) . "\n";

    		foreach($data as $union)
    		{
    			$vals = array_map([$this, 'quote'], $union);
    			$sql .= 'UNION SELECT ' . implode(',', $vals) . "\n";
    		}

    		return [$sql, NULL];
    	}

    	/**
    	 * Generate the returning clause for the current database
    	 *
    	 * @param string $query
    	 * @param string $select
    	 * @return string
    	 */
    	public function returning(string $query, string $select): string
    	{
    		// Return the same query, as the returning clause is not supported
    		return $query;
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/Sqlite/SQL.php.html b/apiDocumentation/source/Drivers/Sqlite/SQL.php.html index 2636c91..6bca43f 100644 --- a/apiDocumentation/source/Drivers/Sqlite/SQL.php.html +++ b/apiDocumentation/source/Drivers/Sqlite/SQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQL.php

    Source of file SQL.php

    - Size: 3,489 Bytes - Last Modified: 2019-12-11T14:04:46-05:00

    src/Drivers/Sqlite/SQL.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Sqlite;

    use Query\Drivers\AbstractSQL;
    use Query\Exception\NotImplementedException;

    /**
     * SQLite Specific SQL
     */
    class SQL extends AbstractSQL {

    	/**
    	 * Get the query plan for the sql query
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string
    	{
    		return "EXPLAIN QUERY PLAN {$sql}";
    	}

    	/**
    	 * Random ordering keyword
    	 *
    	 * @return string
    	 */
    	public function random(): string
    	{
    		return ' RANDOM()';
    	}

    	/**
    	 * Returns sql to list other databases. Meaningless for SQLite, as this
    	 * just returns the database(s) that we are currently connected to.
    	 *
    	 * @return string
    	 */
    	public function dbList(): string
    	{
    		return '';
    	}

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @return string
    	 */
    	public function tableList(): string
    	{
    		return <<<SQL
                SELECT "name" FROM (
    				SELECT * FROM "sqlite_master" UNION ALL
    				SELECT * FROM "sqlite_temp_master"
    			)
            	WHERE "type"='table'
            	AND "name" NOT LIKE "sqlite_%"
            	ORDER BY "name"
    SQL;
    	}

    	/**
    	 * List the system tables
    	 *
    	 * @return string[]
    	 */
    	public function systemTableList(): array
    	{
    		return [
    			'sqlite_master',
    			'sqlite_temp_master',
    			'sqlite_sequence'
    		];
    	}

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string
    	{
    		return <<<SQL
    			SELECT "name" FROM "sqlite_master" WHERE "type" = 'view'
    SQL;
    	}

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): string
    	{
    		return <<<SQL
    			SELECT "name" FROM "sqlite_master" WHERE "type"='trigger'
    SQL;
    	}

    	/**
    	 * Return sql to list functions
    	 *
    	 * @throws NotImplementedException
    	 * @return string
    	 */
    	public function functionList(): string
    	{
    		throw new NotImplementedException('Functionality does not exist in SQLite');
    	}

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @throws NotImplementedException
    	 * @return string
    	 */
    	public function procedureList(): string
    	{
    		throw new NotImplementedException('Functionality does not exist in SQLite');
    	}

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): string
    	{
    		return 'SELECT "name" FROM "sqlite_sequence"';
    	}

    	/**
    	 * SQL to show list of field types
    	 *
    	 * @return string[]
    	 */
    	public function typeList(): array
    	{
    		return ['INTEGER', 'REAL', 'TEXT', 'BLOB', 'NULL'];
    	}

    	/**
    	 * SQL to show information about columns in a table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string
    	{
    		return <<<SQL
    			PRAGMA table_info("$table")
    SQL;
    	}

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string
    	{
    		return <<<SQL
    			PRAGMA foreign_key_list("$table")
    SQL;
    	}


    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string
    	{
    		return <<<SQL
    			PRAGMA index_list("$table")
    SQL;
    	}
    }
    + Size: 3,507 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Drivers/Sqlite/SQL.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Sqlite;

    use Query\Drivers\AbstractSQL;
    use Query\Exception\NotImplementedException;

    /**
     * SQLite Specific SQL
     */
    class SQL extends AbstractSQL {

    	/**
    	 * Get the query plan for the sql query
    	 *
    	 * @param string $sql
    	 * @return string
    	 */
    	public function explain(string $sql): string
    	{
    		return "EXPLAIN QUERY PLAN {$sql}";
    	}

    	/**
    	 * Random ordering keyword
    	 *
    	 * @return string
    	 */
    	public function random(): string
    	{
    		return ' RANDOM()';
    	}

    	/**
    	 * Returns sql to list other databases. Meaningless for SQLite, as this
    	 * just returns the database(s) that we are currently connected to.
    	 *
    	 * @return string
    	 */
    	public function dbList(): string
    	{
    		return '';
    	}

    	/**
    	 * Returns sql to list tables
    	 *
    	 * @return string
    	 */
    	public function tableList(): string
    	{
    		return <<<SQL
                SELECT "name" FROM (
    				SELECT * FROM "sqlite_master" UNION ALL
    				SELECT * FROM "sqlite_temp_master"
    			)
            	WHERE "type"='table'
            	AND "name" NOT LIKE "sqlite_%"
            	ORDER BY "name"
    SQL;
    	}

    	/**
    	 * List the system tables
    	 *
    	 * @return string[]
    	 */
    	public function systemTableList(): array
    	{
    		return [
    			'sqlite_master',
    			'sqlite_temp_master',
    			'sqlite_sequence'
    		];
    	}

    	/**
    	 * Returns sql to list views
    	 *
    	 * @return string
    	 */
    	public function viewList(): string
    	{
    		return <<<SQL
    			SELECT "name" FROM "sqlite_master" WHERE "type" = 'view'
    SQL;
    	}

    	/**
    	 * Returns sql to list triggers
    	 *
    	 * @return string
    	 */
    	public function triggerList(): string
    	{
    		return <<<SQL
    			SELECT "name" FROM "sqlite_master" WHERE "type"='trigger'
    SQL;
    	}

    	/**
    	 * Return sql to list functions
    	 *
    	 * @throws NotImplementedException
    	 * @return string
    	 */
    	public function functionList(): string
    	{
    		throw new NotImplementedException('Functionality does not exist in SQLite');
    	}

    	/**
    	 * Return sql to list stored procedures
    	 *
    	 * @throws NotImplementedException
    	 * @return string
    	 */
    	public function procedureList(): string
    	{
    		throw new NotImplementedException('Functionality does not exist in SQLite');
    	}

    	/**
    	 * Return sql to list sequences
    	 *
    	 * @return string
    	 */
    	public function sequenceList(): string
    	{
    		return 'SELECT "name" FROM "sqlite_sequence"';
    	}

    	/**
    	 * SQL to show list of field types
    	 *
    	 * @return string[]
    	 */
    	public function typeList(): array
    	{
    		return ['INTEGER', 'REAL', 'TEXT', 'BLOB', 'NULL'];
    	}

    	/**
    	 * SQL to show information about columns in a table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function columnList(string $table): string
    	{
    		return <<<SQL
    			PRAGMA table_info("$table")
    SQL;
    	}

    	/**
    	 * Get the list of foreign keys for the current
    	 * table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function fkList(string $table): string
    	{
    		return <<<SQL
    			PRAGMA foreign_key_list("$table")
    SQL;
    	}


    	/**
    	 * Get the list of indexes for the current table
    	 *
    	 * @param string $table
    	 * @return string
    	 */
    	public function indexList(string $table): string
    	{
    		return <<<SQL
    			PRAGMA index_list("$table")
    SQL;
    	}
    }
    diff --git a/apiDocumentation/source/Drivers/Sqlite/Util.php.html b/apiDocumentation/source/Drivers/Sqlite/Util.php.html index 70fc8d7..f2fe24f 100644 --- a/apiDocumentation/source/Drivers/Sqlite/Util.php.html +++ b/apiDocumentation/source/Drivers/Sqlite/Util.php.html @@ -1,3 +1,3 @@ phpDox - Source of Util.php

    Source of file Util.php

    - Size: 2,552 Bytes - Last Modified: 2019-12-11T14:18:53-05:00

    src/Drivers/Sqlite/Util.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Drivers\Sqlite;

    use PDO;
    use Query\Drivers\AbstractUtil;

    /**
     * SQLite-specific backup, import and creation methods
     */
    class Util extends AbstractUtil {

    	/**
    	 * Create an SQL backup file for the current database's data
    	 *
    	 * @param array $excluded
    	 * @return string
    	 */
    	public function backupData(array $excluded=[]): string
    	{
    		// Get a list of all the objects
    		$sql = 'SELECT DISTINCT "name"
    				FROM "sqlite_master"
    				WHERE "type"=\'table\'';

    		if( ! empty($excluded))
    		{
    			$sql .= " AND \"name\" NOT IN('".implode("','", $excluded)."')";
    		}

    		$res = $this->getDriver()->query($sql);
    		$result = $res->fetchAll(PDO::FETCH_ASSOC);

    		unset($res);

    		$outputSql = '';

    		// Get the data for each object
    		foreach($result as $r)
    		{
    			$sql = 'SELECT * FROM "'.$r['name'].'"';
    			$res = $this->getDriver()->query($sql);
    			$objRes = $res->fetchAll(PDO::FETCH_ASSOC);

    			unset($res);

    			// If the row is empty, continue;
    			if (empty($objRes))
    			{
    				continue;
    			}

    			// Nab the column names by getting the keys of the first row
    			$columns = array_keys(current($objRes));

    			$insertRows = [];

    			// Create the insert statements
    			foreach($objRes as $row)
    			{
    				$row = array_values($row);

    				// Quote values as needed by type
    				foreach ($row as $i => $_)
    				{
    					$row[$i] = (is_numeric($row[$i]))
    						? $row[$i]
    						: $this->getDriver()->quote($row[$i]);
    				}

    				$rowString = 'INSERT INTO "'.$r['name'].'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

    				unset($row);

    				$insertRows[] = $rowString;
    			}

    			unset($objRes);

    			$outputSql .= "\n\n".implode("\n", $insertRows);
    		}

    		return $outputSql;
    	}

    	/**
    	 * Create an SQL backup file for the current database's structure
    	 *
    	 * @return string
    	 */
    	public function backupStructure(): string
    	{
    		// Fairly easy for SQLite...just query the master table
    		$sql = 'SELECT "sql" FROM "sqlite_master"';
    		$res = $this->getDriver()->query($sql);
    		$result = $res->fetchAll(PDO::FETCH_ASSOC);

    		$sqlArray = [];

    		foreach($result as $r)
    		{
    			$sqlArray[] = $r['sql'];
    		}

    		return implode(";\n", $sqlArray) . ';';
    	}
    }
    + Size: 2,569 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/Drivers/Sqlite/Util.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Drivers\Sqlite;

    use PDO;
    use Query\Drivers\AbstractUtil;

    /**
     * SQLite-specific backup, import and creation methods
     */
    class Util extends AbstractUtil {

    	/**
    	 * Create an SQL backup file for the current database's data
    	 *
    	 * @param array $excluded
    	 * @return string
    	 */
    	public function backupData(array $excluded=[]): string
    	{
    		// Get a list of all the objects
    		$sql = 'SELECT DISTINCT "name"
    				FROM "sqlite_master"
    				WHERE "type"=\'table\'';

    		if( ! empty($excluded))
    		{
    			$sql .= " AND \"name\" NOT IN('".implode("','", $excluded)."')";
    		}

    		$res = $this->getDriver()->query($sql);
    		$result = $res->fetchAll(PDO::FETCH_ASSOC);

    		unset($res);

    		$outputSql = '';

    		// Get the data for each object
    		foreach($result as $r)
    		{
    			$sql = 'SELECT * FROM "'.$r['name'].'"';
    			$res = $this->getDriver()->query($sql);
    			$objRes = $res->fetchAll(PDO::FETCH_ASSOC);

    			unset($res);

    			// If the row is empty, continue
    			if (empty($objRes))
    			{
    				continue;
    			}

    			// Nab the column names by getting the keys of the first row
    			$columns = array_keys(current($objRes));

    			$insertRows = [];

    			// Create the insert statements
    			foreach($objRes as $row)
    			{
    				$row = array_values($row);

    				// Quote values as needed by type
    				foreach ($row as $i => $_)
    				{
    					$row[$i] = (is_numeric($row[$i]))
    						? $row[$i]
    						: $this->getDriver()->quote($row[$i]);
    				}

    				$rowString = 'INSERT INTO "'.$r['name'].'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

    				unset($row);

    				$insertRows[] = $rowString;
    			}

    			unset($objRes);

    			$outputSql .= "\n\n".implode("\n", $insertRows);
    		}

    		return $outputSql;
    	}

    	/**
    	 * Create an SQL backup file for the current database's structure
    	 *
    	 * @return string
    	 */
    	public function backupStructure(): string
    	{
    		// Fairly easy for SQLite...just query the master table
    		$sql = 'SELECT "sql" FROM "sqlite_master"';
    		$res = $this->getDriver()->query($sql);
    		$result = $res->fetchAll(PDO::FETCH_ASSOC);

    		$sqlArray = [];

    		foreach($result as $r)
    		{
    			$sqlArray[] = $r['sql'];
    		}

    		return implode(";\n", $sqlArray) . ';';
    	}
    }
    diff --git a/apiDocumentation/source/Exception/BadDBDriverException.php.html b/apiDocumentation/source/Exception/BadDBDriverException.php.html index c08058a..be20b16 100644 --- a/apiDocumentation/source/Exception/BadDBDriverException.php.html +++ b/apiDocumentation/source/Exception/BadDBDriverException.php.html @@ -1,3 +1,3 @@ phpDox - Source of BadDBDriverException.php

    Source of file BadDBDriverException.php

    - Size: 0,560 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Exception/BadDBDriverException.php

    1234567891011121314151617181920212223
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Exception;

    use InvalidArgumentException;

    /**
     * Generic exception for bad drivers
     */
    class BadDBDriverException extends InvalidArgumentException {
    }
    + Size: 0,578 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Exception/BadDBDriverException.php

    123456789101112131415161718192021222324
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Exception;

    use InvalidArgumentException;

    /**
     * Generic exception for bad drivers
     */
    class BadDBDriverException extends InvalidArgumentException {
    }
    diff --git a/apiDocumentation/source/Exception/NonExistentConnectionException.php.html b/apiDocumentation/source/Exception/NonExistentConnectionException.php.html index 9ea0ce6..269db81 100644 --- a/apiDocumentation/source/Exception/NonExistentConnectionException.php.html +++ b/apiDocumentation/source/Exception/NonExistentConnectionException.php.html @@ -1,3 +1,3 @@ phpDox - Source of NonExistentConnectionException.php

    Source of file NonExistentConnectionException.php

    - Size: 0,578 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Exception/NonExistentConnectionException.php

    1234567891011121314151617181920212223
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Exception;

    use InvalidArgumentException;

    /**
     * Exception for missing database connection
     */
    class NonExistentConnectionException extends InvalidArgumentException {
    }
    + Size: 0,596 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Exception/NonExistentConnectionException.php

    123456789101112131415161718192021222324
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Exception;

    use InvalidArgumentException;

    /**
     * Exception for missing database connection
     */
    class NonExistentConnectionException extends InvalidArgumentException {
    }
    diff --git a/apiDocumentation/source/Exception/NotImplementedException.php.html b/apiDocumentation/source/Exception/NotImplementedException.php.html index 9411c67..d1124c1 100644 --- a/apiDocumentation/source/Exception/NotImplementedException.php.html +++ b/apiDocumentation/source/Exception/NotImplementedException.php.html @@ -1,3 +1,3 @@ phpDox - Source of NotImplementedException.php

    Source of file NotImplementedException.php

    - Size: 0,561 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/Exception/NotImplementedException.php

    1234567891011121314151617181920212223
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query\Exception;

    use BadMethodCallException;

    /**
     * Exception for non-implemented method
     */
    class NotImplementedException extends BadMethodCallException{
    }
    + Size: 0,579 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/Exception/NotImplementedException.php

    123456789101112131415161718192021222324
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query\Exception;

    use BadMethodCallException;

    /**
     * Exception for non-implemented method
     */
    class NotImplementedException extends BadMethodCallException{
    }
    diff --git a/apiDocumentation/source/MapType.php.html b/apiDocumentation/source/MapType.php.html new file mode 100644 index 0000000..436e983 --- /dev/null +++ b/apiDocumentation/source/MapType.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of MapType.php

    Source of file MapType.php

    + Size: 0,691 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/MapType.php

    12345678910111213141516171819202122232425262728
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    /**
     * 'Enum' of query map types
     */
    class MapType {
    	public const GROUP_END = 'group_end';
    	public const GROUP_START = 'group_start';
    	public const JOIN = 'join';
    	public const LIKE = 'like';
    	public const WHERE = 'where';
    	public const WHERE_IN = 'where_in';
    }
    diff --git a/apiDocumentation/source/QueryBuilder.php.html b/apiDocumentation/source/QueryBuilder.php.html index 9e8a207..9dc8aca 100644 --- a/apiDocumentation/source/QueryBuilder.php.html +++ b/apiDocumentation/source/QueryBuilder.php.html @@ -1,3 +1,3 @@ phpDox - Source of QueryBuilder.php

    Source of file QueryBuilder.php

    - Size: 30,873 Bytes - Last Modified: 2019-12-11T16:15:51-05:00

    src/QueryBuilder.php

    12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query;

    use function regexInArray;

    use BadMethodCallException;
    use PDO;
    use PDOStatement;
    use Query\Drivers\DriverInterface;

    /**
     * Convenience class for creating sql queries
     *
     * @method affectedRows(): int
     * @method beginTransaction(): bool
     * @method commit(): bool
     * @method errorCode(): string
     * @method errorInfo(): array
     * @method exec(string $statement): int
     * @method getAttribute(int $attribute)
     * @method getColumns(string $table): array | null
     * @method getDbs(): array | null
     * @method getFks(string $table): array | null
     * @method getFunctions(): array | null
     * @method getIndexes(string $table): array | null
     * @method getLastQuery(): string
     * @method getProcedures(): array | null
     * @method getSchemas(): array | null
     * @method getSequences(): array | null
     * @method getSystemTables(): array | null
     * @method getTables(): array
     * @method getTriggers(): array | null
     * @method getTypes(): array | null
     * @method getUtil(): \Query\Drivers\AbstractUtil
     * @method getViews(): array | null
     * @method inTransaction(): bool
     * @method lastInsertId(string $name = NULL): string
     * @method numRows(): int | null
     * @method prepare(string $statement, array $driver_options = []): PDOStatement
     * @method prepareExecute(string $sql, array $params): PDOStatement
     * @method prepareQuery(string $sql, array $data): PDOStatement
     * @method query(string $statement): PDOStatement
     * @method quote(string $string, int $parameter_type = PDO::PARAM_STR): string
     * @method rollback(): bool
     * @method setAttribute(int $attribute, $value): bool
     * @method setTablePrefix(string $prefix): void
     * @method truncate(string $table): PDOStatement
     */
    class QueryBuilder implements QueryBuilderInterface {

    	/**
    	 * Convenience property for connection management
    	 * @var string
    	 */
    	public $connName = '';

    	/**
    	 * List of queries executed
    	 * @var array
    	 */
    	public $queries = [
    		'total_time' => 0
    	];

    	/**
    	 * Whether to do only an explain on the query
    	 * @var boolean
    	 */
    	protected $explain = FALSE;

    	/**
    	 * The current database driver
    	 * @var DriverInterface
    	 */
    	protected $driver;

    	/**
    	 * Query parser class instance
    	 * @var QueryParser
    	 */
    	protected $parser;

    	/**
    	 * Query Builder state
    	 * @var State
    	 */
    	protected $state;

    	// --------------------------------------------------------------------------
    	// ! Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Constructor
    	 *
    	 * @param DriverInterface $driver
    	 * @param QueryParser $parser
    	 */
    	public function __construct(DriverInterface $driver, QueryParser $parser)
    	{
    		// Inject driver and parser
    		$this->driver = $driver;
    		$this->parser = $parser;

    		// Create new State object
    		$this->state = new State();
    	}

    	/**
    	 * Destructor
    	 * @codeCoverageIgnore
    	 */
    	public function __destruct()
    	{
    		$this->driver = NULL;
    	}

    	/**
    	 * Calls a function further down the inheritance chain.
    	 * 'Implements' methods on the driver object
    	 *
    	 * @param string $name
    	 * @param array $params
    	 * @return mixed
    	 * @throws BadMethodCallException
    	 */
    	public function __call(string $name, array $params)
    	{
    		if (method_exists($this->driver, $name))
    		{
    			return \call_user_func_array([$this->driver, $name], $params);
    		}

    		throw new BadMethodCallException('Method does not exist');
    	}

    	// --------------------------------------------------------------------------
    	// ! Select Queries
    	// --------------------------------------------------------------------------

    	/**
    	 * Specifies rows to select in a query
    	 *
    	 * @param string $fields
    	 * @return QueryBuilderInterface
    	 */
    	public function select(string $fields): QueryBuilderInterface
    	{
    		// Split fields by comma
    		$fieldsArray = explode(',', $fields);
    		$fieldsArray = array_map('mb_trim', $fieldsArray);

    		// Split on 'As'
    		foreach ($fieldsArray as $key => $field)
    		{
    			if (stripos($field, 'as') !== FALSE)
    			{
    				$fieldsArray[$key] = preg_split('` as `i', $field);
    				$fieldsArray[$key] = array_map('mb_trim', $fieldsArray[$key]);
    			}
    		}

    		// Quote the identifiers
    		$safeArray = $this->driver->quoteIdent($fieldsArray);

    		unset($fieldsArray);

    		// Join the strings back together
    		for($i = 0, $c = count($safeArray); $i < $c; $i++)
    		{
    			if (\is_array($safeArray[$i]))
    			{
    				$safeArray[$i] = implode(' AS ', $safeArray[$i]);
    			}
    		}

    		$this->state->appendSelectString(implode(', ', $safeArray));

    		return $this;
    	}

    	/**
    	 * Selects the maximum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return QueryBuilderInterface
    	 */
    	public function selectMax(string $field, $as=FALSE): QueryBuilderInterface
    	{
    		// Create the select string
    		$this->state->appendSelectString(' MAX'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * Selects the minimum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return QueryBuilderInterface
    	 */
    	public function selectMin(string $field, $as=FALSE): QueryBuilderInterface
    	{
    		// Create the select string
    		$this->state->appendSelectString(' MIN'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * Selects the average value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return QueryBuilderInterface
    	 */
    	public function selectAvg(string $field, $as=FALSE): QueryBuilderInterface
    	{
    		// Create the select string
    		$this->state->appendSelectString(' AVG'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * Selects the sum of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return QueryBuilderInterface
    	 */
    	public function selectSum(string $field, $as=FALSE): QueryBuilderInterface
    	{
    		// Create the select string
    		$this->state->appendSelectString(' SUM'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * @todo implement
    	 * @param string $fields
    	 * @return $this
    	 */
    	public function returning(string $fields = '*'): QueryBuilderInterface
    	{
    		return $this;
    	}

    	/**
    	 * Adds the 'distinct' keyword to a query
    	 *
    	 * @return QueryBuilderInterface
    	 */
    	public function distinct(): QueryBuilderInterface
    	{
    		// Prepend the keyword to the select string
    		$this->state->setSelectString(' DISTINCT' . $this->state->getSelectString());
    		return $this;
    	}

    	/**
    	 * Tell the database to give you the query plan instead of result set
    	 *
    	 * @return QueryBuilderInterface
    	 */
    	public function explain(): QueryBuilderInterface
    	{
    		$this->explain = TRUE;
    		return $this;
    	}

    	/**
    	 * Specify the database table to select from
    	 *
    	 * @param string $tblname
    	 * @return QueryBuilderInterface
    	 */
    	public function from(string $tblname): QueryBuilderInterface
    	{
    		// Split identifiers on spaces
    		$identArray = explode(' ', \mb_trim($tblname));
    		$identArray = array_map('\\mb_trim', $identArray);

    		// Quote the identifiers
    		$identArray[0] = $this->driver->quoteTable($identArray[0]);
    		$identArray = $this->driver->quoteIdent($identArray);

    		// Paste it back together
    		$this->state->setFromString(implode(' ', $identArray));

    		return $this;
    	}

    	// --------------------------------------------------------------------------
    	// ! 'Like' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Creates a Like clause in the sql statement
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return QueryBuilderInterface
    	 */
    	public function like(string $field, $val, string $pos='both'): QueryBuilderInterface
    	{
    		return $this->_like($field, $val, $pos);
    	}

    	/**
    	 * Generates an OR Like clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return QueryBuilderInterface
    	 */
    	public function orLike(string $field, $val, string $pos='both'): QueryBuilderInterface
    	{
    		return $this->_like($field, $val, $pos, 'LIKE', 'OR');
    	}

    	/**
    	 * Generates a NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return QueryBuilderInterface
    	 */
    	public function notLike(string $field, $val, string $pos='both'): QueryBuilderInterface
    	{
    		return $this->_like($field, $val, $pos, 'NOT LIKE');
    	}

    	/**
    	 * Generates a OR NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return QueryBuilderInterface
    	 */
    	public function orNotLike(string $field, $val, string $pos='both'): QueryBuilderInterface
    	{
    		return $this->_like($field, $val, $pos, 'NOT LIKE', 'OR');
    	}

    	// --------------------------------------------------------------------------
    	// ! Having methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Generates a 'Having' clause
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function having($key, $val=[]): QueryBuilderInterface
    	{
    		return $this->_having($key, $val);
    	}

    	/**
    	 * Generates a 'Having' clause prefixed with 'OR'
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function orHaving($key, $val=[]): QueryBuilderInterface
    	{
    		return $this->_having($key, $val, 'OR');
    	}

    	// --------------------------------------------------------------------------
    	// ! 'Where' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Specify condition(s) in the where clause of a query
    	 * Note: this function works with key / value, or a
    	 * passed array with key / value pairs
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @param mixed $escape
    	 * @return QueryBuilderInterface
    	 */
    	public function where($key, $val=[], $escape=NULL): QueryBuilderInterface
    	{
    		return $this->_whereString($key, $val);
    	}

    	/**
    	 * Where clause prefixed with "OR"
    	 *
    	 * @param string $key
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function orWhere($key, $val=[]): QueryBuilderInterface
    	{
    		return $this->_whereString($key, $val, 'OR');
    	}

    	/**
    	 * Where clause with 'IN' statement
    	 *
    	 * @param mixed $field
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function whereIn($field, $val=[]): QueryBuilderInterface
    	{
    		return $this->_whereIn($field, $val);
    	}

    	/**
    	 * Where in statement prefixed with "or"
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function orWhereIn($field, $val=[]): QueryBuilderInterface
    	{
    		return $this->_whereIn($field, $val, 'IN', 'OR');
    	}

    	/**
    	 * WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function whereNotIn($field, $val=[]): QueryBuilderInterface
    	{
    		return $this->_whereIn($field, $val, 'NOT IN');
    	}

    	/**
    	 * OR WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function orWhereNotIn($field, $val=[]): QueryBuilderInterface
    	{
    		return $this->_whereIn($field, $val, 'NOT IN', 'OR');
    	}

    	// --------------------------------------------------------------------------
    	// ! Other Query Modifier methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Sets values for inserts / updates / deletes
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return QueryBuilderInterface
    	 */
    	public function set($key, $val = NULL): QueryBuilderInterface
    	{
    		if (is_scalar($key))
    		{
    			$pairs = [$key => $val];
    		}
    		else
    		{
    			$pairs = $key;
    		}

    		$keys = array_keys($pairs);
    		$values = array_values($pairs);

    		$this->state->appendSetArrayKeys($keys);
    		$this->state->appendValues($values);

    		// Use the keys of the array to make the insert/update string
    		// Escape the field names
    		$this->state->setSetArrayKeys(
    			array_map([$this->driver, '_quote'], $this->state->getSetArrayKeys())
    		);

    		// Generate the "set" string
    		$setString = implode('=?,', $this->state->getSetArrayKeys());
    		$setString .= '=?';

    		$this->state->setSetString($setString);

    		return $this;
    	}

    	/**
    	 * Creates a join phrase in a compiled query
    	 *
    	 * @param string $table
    	 * @param string $condition
    	 * @param string $type
    	 * @return QueryBuilderInterface
    	 */
    	public function join(string $table, string $condition, string $type=''): QueryBuilderInterface
    	{
    		// Prefix and quote table name
    		$table = explode(' ', mb_trim($table));
    		$table[0] = $this->driver->quoteTable($table[0]);
    		$table = $this->driver->quoteIdent($table);
    		$table = implode(' ', $table);

    		// Parse out the join condition
    		$parsedCondition = $this->parser->compileJoin($condition);
    		$condition = $table . ' ON ' . $parsedCondition;

    		$this->state->appendMap("\n" . strtoupper($type) . ' JOIN ', $condition, 'join');

    		return $this;
    	}

    	/**
    	 * Group the results by the selected field(s)
    	 *
    	 * @param mixed $field
    	 * @return QueryBuilderInterface
    	 */
    	public function groupBy($field): QueryBuilderInterface
    	{
    		if ( ! is_scalar($field))
    		{
    			$newGroupArray = array_map([$this->driver, 'quoteIdent'], $field);
    			$this->state->setGroupArray(
    				array_merge($this->state->getGroupArray(), $newGroupArray)
    			);
    		}
    		else
    		{
    			$this->state->appendGroupArray($this->driver->quoteIdent($field));
    		}

    		$this->state->setGroupString(' GROUP BY ' . implode(',', $this->state->getGroupArray()));

    		return $this;
    	}

    	/**
    	 * Order the results by the selected field(s)
    	 *
    	 * @param string $field
    	 * @param string $type
    	 * @return QueryBuilderInterface
    	 */
    	public function orderBy(string $field, string $type=''): QueryBuilderInterface
    	{
    		// When ordering by random, do an ascending order if the driver
    		// doesn't support random ordering
    		if (stripos($type, 'rand') !== FALSE)
    		{
    			$rand = $this->driver->getSql()->random();
    			$type = $rand ?? 'ASC';
    		}

    		// Set fields for later manipulation
    		$field = $this->driver->quoteIdent($field);
    		$this->state->setOrderArray($field, $type);

    		$orderClauses = [];

    		// Flatten key/val pairs into an array of space-separated pairs
    		foreach($this->state->getOrderArray() as $k => $v)
    		{
    			$orderClauses[] = $k . ' ' . strtoupper($v);
    		}

    		// Set the final string
    		$orderString =  ! isset($rand)
    			? "\nORDER BY ".implode(', ', $orderClauses)
    			: "\nORDER BY".$rand;

    		$this->state->setOrderString($orderString);

    		return $this;
    	}

    	/**
    	 * Set a limit on the current sql statement
    	 *
    	 * @param int $limit
    	 * @param int|bool $offset
    	 * @return QueryBuilderInterface
    	 */
    	public function limit(int $limit, $offset=FALSE): QueryBuilderInterface
    	{
    		$this->state->setLimit($limit);
    		$this->state->setOffset($offset);

    		return $this;
    	}

    	// --------------------------------------------------------------------------
    	// ! Query Grouping Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Adds a paren to the current query for query grouping
    	 *
    	 * @return QueryBuilderInterface
    	 */
    	public function groupStart(): QueryBuilderInterface
    	{
    		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' ';

    		$this->state->appendMap($conj, '(', 'group_start');

    		return $this;
    	}

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'NOT'
    	 *
    	 * @return QueryBuilderInterface
    	 */
    	public function notGroupStart(): QueryBuilderInterface
    	{
    		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';

    		$this->state->appendMap($conj, ' NOT (', 'group_start');

    		return $this;
    	}

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR'
    	 *
    	 * @return QueryBuilderInterface
    	 */
    	public function orGroupStart(): QueryBuilderInterface
    	{
    		$this->state->appendMap('', ' OR (', 'group_start');

    		return $this;
    	}

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR NOT'
    	 *
    	 * @return QueryBuilderInterface
    	 */
    	public function orNotGroupStart(): QueryBuilderInterface
    	{
    		$this->state->appendMap('', ' OR NOT (', 'group_start');

    		return $this;
    	}

    	/**
    	 * Ends a query group
    	 *
    	 * @return QueryBuilderInterface
    	 */
    	public function groupEnd(): QueryBuilderInterface
    	{
    		$this->state->appendMap('', ')', 'group_end');

    		return $this;
    	}

    	// --------------------------------------------------------------------------
    	// ! Query execution methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Select and retrieve all records from the current table, and/or
    	 * execute current compiled query
    	 *
    	 * @param string $table
    	 * @param int|bool $limit
    	 * @param int|bool $offset
    	 * @return PDOStatement
    	 */
    	public function get(string $table='', $limit=FALSE, $offset=FALSE): PDOStatement
    	{
    		// Set the table
    		if ( ! empty($table))
    		{
    			$this->from($table);
    		}

    		// Set the limit, if it exists
    		if (\is_int($limit))
    		{
    			$this->limit($limit, $offset);
    		}

    		return $this->_run('get', $table);
    	}

    	/**
    	 * Convenience method for get() with a where clause
    	 *
    	 * @param string $table
    	 * @param mixed $where
    	 * @param int|bool $limit
    	 * @param int|bool $offset
    	 * @return PDOStatement
    	 */
    	public function getWhere(string $table, $where=[], $limit=FALSE, $offset=FALSE): PDOStatement
    	{
    		// Create the where clause
    		$this->where($where);

    		// Return the result
    		return $this->get($table, $limit, $offset);
    	}

    	/**
    	 * Retrieve the number of rows in the selected table
    	 *
    	 * @param string $table
    	 * @return int
    	 */
    	public function countAll(string $table): int
    	{
    		$sql = 'SELECT * FROM '.$this->driver->quoteTable($table);
    		$res = $this->driver->query($sql);
    		return (int) count($res->fetchAll());
    	}

    	/**
    	 * Retrieve the number of results for the generated query - used
    	 * in place of the get() method
    	 *
    	 * @param string $table
    	 * @param boolean $reset
    	 * @return int
    	 */
    	public function countAllResults(string $table='', bool $reset = TRUE): int
    	{
    		// Set the table
    		if ( ! empty($table))
    		{
    			$this->from($table);
    		}

    		$result = $this->_run('get', $table, NULL, NULL, $reset);
    		$rows = $result->fetchAll();

    		return (int) count($rows);
    	}

    	/**
    	 * Creates an insert clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function insert(string $table, $data=[]): PDOStatement
    	{
    		if ( ! empty($data))
    		{
    			$this->set($data);
    		}

    		return $this->_run('insert', $table);
    	}

    	/**
    	 * Creates and executes a batch insertion query
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @return PDOStatement
    	 */
    	public function insertBatch(string $table, $data=[]): PDOStatement
    	{
    		// Get the generated values and sql string
    		[$sql, $data] = $this->driver->insertBatch($table, $data);

    		return $sql !== NULL
    			? $this->_run('', $table, $sql, $data)
    			: NULL;
    	}

    	/**
    	 * Creates an update clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function update(string $table, $data=[]): PDOStatement
    	{
    		if ( ! empty($data))
    		{
    			$this->set($data);
    		}

    		return $this->_run('update', $table);
    	}

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @param string $where
    	 * @return int|null
    	 */
    	public function updateBatch(string $table, array $data, string $where): ?int
    	{
    		if (empty($table) || empty($data) || empty($where))
    		{
    			return NULL;
    		}

    		// Get the generated values and sql string
    		[$sql, $data, $affectedRows] = $this->driver->updateBatch($table, $data, $where);

    		$this->_run('', $table, $sql, $data);
    		return $affectedRows;
    	}

    	/**
    	 * Deletes data from a table
    	 *
    	 * @param string $table
    	 * @param mixed $where
    	 * @return PDOStatement
    	 */
    	public function delete(string $table, $where=''): PDOStatement
    	{
    		// Set the where clause
    		if ( ! empty($where))
    		{
    			$this->where($where);
    		}

    		return $this->_run('delete', $table);
    	}

    	// --------------------------------------------------------------------------
    	// ! SQL Returning Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Returns the generated 'select' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledSelect(string $table='', bool $reset=TRUE): string
    	{
    		// Set the table
    		if ( ! empty($table))
    		{
    			$this->from($table);
    		}

    		return $this->_getCompile('select', $table, $reset);
    	}

    	/**
    	 * Returns the generated 'insert' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledInsert(string $table, bool $reset=TRUE): string
    	{
    		return $this->_getCompile('insert', $table, $reset);
    	}

    	/**
    	 * Returns the generated 'update' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledUpdate(string $table='', bool $reset=TRUE): string
    	{
    		return $this->_getCompile('update', $table, $reset);
    	}

    	/**
    	 * Returns the generated 'delete' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledDelete(string $table='', bool $reset=TRUE): string
    	{
    		return $this->_getCompile('delete', $table, $reset);
    	}

    	// --------------------------------------------------------------------------
    	// ! Miscellaneous Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Clear out the class variables, so the next query can be run
    	 *
    	 * @return void
    	 */
    	public function resetQuery(): void
    	{
    		$this->state = new State();
    		$this->explain = FALSE;
    	}

    	/**
    	 * Method to simplify select_ methods
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return string
    	 */
    	protected function _select(string $field, $as = FALSE): string
    	{
    		// Escape the identifiers
    		$field = $this->driver->quoteIdent($field);

    		if ( ! \is_string($as))
    		{
    			// @codeCoverageIgnoreStart
    			return $field;
    			// @codeCoverageIgnoreEnd
    		}

    		$as = $this->driver->quoteIdent($as);
    		return "({$field}) AS {$as} ";
    	}

    	/**
    	 * Helper function for returning sql strings
    	 *
    	 * @param string $type
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	protected function _getCompile(string $type, string $table, bool $reset): string
    	{
    		$sql = $this->_compile($type, $table);

    		// Reset the query builder for the next query
    		if ($reset)
    		{
    			$this->resetQuery();
    		}

    		return $sql;
    	}

    	/**
    	 * Simplify 'like' methods
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @param string $like
    	 * @param string $conj
    	 * @return QueryBuilderInterface
    	 */
    	protected function _like(string $field, $val, string $pos, string $like='LIKE', string $conj='AND'): QueryBuilderInterface
    	{
    		$field = $this->driver->quoteIdent($field);

    		// Add the like string into the order map
    		$like = $field. " {$like} ?";

    		if ($pos === 'before')
    		{
    			$val = "%{$val}";
    		}
    		elseif ($pos === 'after')
    		{
    			$val = "{$val}%";
    		}
    		else
    		{
    			$val = "%{$val}%";
    		}

    		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
    		$this->state->appendMap($conj, $like, 'like');

    		// Add to the values array
    		$this->state->appendWhereValues($val);

    		return $this;
    	}

    	/**
    	 * Simplify building having clauses
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @param string $conj
    	 * @return QueryBuilderInterface
    	 */
    	protected function _having($key, $values=[], string $conj='AND'): QueryBuilderInterface
    	{
    		$where = $this->_where($key, $values);

    		// Create key/value placeholders
    		foreach($where as $f => $val)
    		{
    			// Split each key by spaces, in case there
    			// is an operator such as >, <, !=, etc.
    			$fArray = explode(' ', trim($f));

    			$item = $this->driver->quoteIdent($fArray[0]);

    			// Simple key value, or an operator
    			$item .= (count($fArray) === 1) ? '=?' : " {$fArray[1]} ?";

    			// Put in the having map
    			$this->state->appendHavingMap([
    				'conjunction' => empty($this->state->getHavingMap())
    					? ' HAVING '
    					: " {$conj} ",
    				'string' => $item
    			]);
    		}

    		return $this;
    	}

    	/**
    	 * Do all the redundant stuff for where/having type methods
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return array
    	 */
    	protected function _where($key, $val=[]): array
    	{
    		$where = [];
    		$pairs = [];

    		if (is_scalar($key))
    		{
    			$pairs[$key] = $val;
    		}
    		else
    		{
    			$pairs = $key;
    		}

    		foreach($pairs as $k => $v)
    		{
    			$where[$k] = $v;
    			$this->state->appendWhereValues($v);
    		}

    		return $where;
    	}

    	/**
    	 * Simplify generating where string
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @param string $defaultConj
    	 * @return QueryBuilderInterface
    	 */
    	protected function _whereString($key, $values=[], string $defaultConj='AND'): QueryBuilderInterface
    	{
    		// Create key/value placeholders
    		foreach($this->_where($key, $values) as $f => $val)
    		{
    			$queryMap = $this->state->getQueryMap();

    			// Split each key by spaces, in case there
    			// is an operator such as >, <, !=, etc.
    			$fArray = explode(' ', trim($f));

    			$item = $this->driver->quoteIdent($fArray[0]);

    			// Simple key value, or an operator
    			$item .= (count($fArray) === 1) ? '=?' : " {$fArray[1]} ?";
    			$lastItem = end($queryMap);

    			// Determine the correct conjunction
    			$conjunctionList = array_column($queryMap, 'conjunction');
    			if (empty($queryMap) || ( ! regexInArray($conjunctionList, "/^ ?\n?WHERE/i")))
    			{
    				$conj = "\nWHERE ";
    			}
    			elseif ($lastItem['type'] === 'group_start')
    			{
    				$conj = '';
    			}
    			else
    			{
    				$conj = " {$defaultConj} ";
    			}

    			$this->state->appendMap($conj, $item, 'where');
    		}

    		return $this;
    	}

    	/**
    	 * Simplify where_in methods
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @param string $in - The (not) in fragment
    	 * @param string $conj - The where in conjunction
    	 * @return QueryBuilderInterface
    	 */
    	protected function _whereIn($key, $val=[], string $in='IN', string $conj='AND'): QueryBuilderInterface
    	{
    		$key = $this->driver->quoteIdent($key);
    		$params = array_fill(0, count($val), '?');
    		$this->state->appendWhereValues($val);

    		$conjunction =  empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
    		$str = $key . " {$in} (".implode(',', $params).') ';

    		$this->state->appendMap($conjunction, $str, 'where_in');

    		return $this;
    	}

    	/**
    	 * Executes the compiled query
    	 *
    	 * @param string $type
    	 * @param string $table
    	 * @param string $sql
    	 * @param array|null $vals
    	 * @param boolean $reset
    	 * @return PDOStatement
    	 */
    	protected function _run(string $type, string $table, string $sql=NULL, array $vals=NULL, bool $reset=TRUE): PDOStatement
    	{
    		if ($sql === NULL)
    		{
    			$sql = $this->_compile($type, $table);
    		}

    		if ($vals === NULL)
    		{
    			$vals = array_merge($this->state->getValues(), $this->state->getWhereValues());
    		}

    		$startTime = microtime(TRUE);

    		$res = empty($vals)
    			? $this->driver->query($sql)
    			: $this->driver->prepareExecute($sql, $vals);

    		$endTime = microtime(TRUE);
    		$totalTime = number_format($endTime - $startTime, 5);

    		// Add this query to the list of executed queries
    		$this->_appendQuery($vals, $sql, (int) $totalTime);

    		// Reset class state for next query
    		if ($reset)
    		{
    			$this->resetQuery();
    		}

    		return $res;
    	}

    	/**
    	 * Convert the prepared statement into readable sql
    	 *
    	 * @param array $values
    	 * @param string $sql
    	 * @param int $totalTime
    	 * @return void
    	 */
    	protected function _appendQuery(array $values, string $sql, int $totalTime): void
    	{
    		$evals = \is_array($values) ? $values : [];
    		$esql = str_replace('?', '%s', $sql);

    		// Quote string values
    		foreach($evals as &$v)
    		{
    			$v = ( ! is_numeric($v))
    				? htmlentities($this->driver->quote($v), ENT_NOQUOTES, 'utf-8')
    				: $v;
    		}
    		unset($v);

    		// Add the query onto the array of values to pass
    		// as arguments to sprintf
    		array_unshift($evals, $esql);

    		// Add the interpreted query to the list of executed queries
    		$this->queries[] = [
    			'time' => $totalTime,
    			'sql' => sprintf(...$evals)
    		];

    		$this->queries['total_time'] += $totalTime;

    		// Set the last query to get rowcounts properly
    		$this->driver->setLastQuery($sql);
    	}

    	/**
    	 * Sub-method for generating sql strings
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $type
    	 * @param string $table
    	 * @return string
    	 */
    	protected function _compileType(string $type='', string $table=''): string
    	{
    		$setArrayKeys = $this->state->getSetArrayKeys();
    		switch($type)
    		{
    			case 'insert':
    				$paramCount = count($setArrayKeys);
    				$params = array_fill(0, $paramCount, '?');
    				$sql = "INSERT INTO {$table} ("
    					. implode(',', $setArrayKeys)
    					. ")\nVALUES (".implode(',', $params).')';
    				break;

    			case 'update':
    				$setString = $this->state->getSetString();
    				$sql = "UPDATE {$table}\nSET {$setString}";
    				break;

    			case 'delete':
    				$sql = "DELETE FROM {$table}";
    				break;

    			// Get queries
    			default:
    				$fromString = $this->state->getFromString();
    				$selectString = $this->state->getSelectString();

    				$sql = "SELECT * \nFROM {$fromString}";

    				// Set the select string
    				if ( ! empty($selectString))
    				{
    					// Replace the star with the selected fields
    					$sql = str_replace('*', $selectString, $sql);
    				}
    				break;
    		}

    		return $sql;
    	}

    	/**
    	 * String together the sql statements for sending to the db
    	 *
    	 * @param string $type
    	 * @param string $table
    	 * @return string
    	 */
    	protected function _compile(string $type='', string $table=''): string
    	{
    		// Get the base clause for the query
    		$sql = $this->_compileType($type, $this->driver->quoteTable($table));

    		$clauses = [
    			'queryMap',
    			'groupString',
    			'orderString',
    			'havingMap',
    		];

    		// Set each type of subclause
    		foreach($clauses as $clause)
    		{
    			$func = 'get' . ucFirst($clause);
    			$param = $this->state->$func();
    			if (\is_array($param))
    			{
    				foreach($param as $q)
    				{
    					$sql .= $q['conjunction'] . $q['string'];
    				}
    			}
    			else
    			{
    				$sql .= $param;
    			}
    		}

    		// Set the limit via the class variables
    		$limit = $this->state->getLimit();
    		if (is_numeric($limit))
    		{
    			$sql = $this->driver->getSql()->limit($sql, $limit, $this->state->getOffset());
    		}

    		// See if the query plan, rather than the
    		// query data should be returned
    		if ($this->explain === TRUE)
    		{
    			$sql = $this->driver->getSql()->explain($sql);
    		}

    		return $sql;
    	}
    }

    + Size: 17,878 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/QueryBuilder.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    use function is_array;
    use function is_int;

    use PDOStatement;

    /**
     * Convenience class for creating sql queries
     */
    class QueryBuilder extends QueryBuilderBase implements QueryBuilderInterface {
    	// --------------------------------------------------------------------------
    	// ! Select Queries
    	// --------------------------------------------------------------------------

    	/**
    	 * Specifies rows to select in a query
    	 *
    	 * @param string $fields
    	 * @return self
    	 */
    	public function select(string $fields): self
    	{
    		// Split fields by comma
    		$fieldsArray = explode(',', $fields);
    		$fieldsArray = array_map('mb_trim', $fieldsArray);

    		// Split on 'As'
    		foreach ($fieldsArray as $key => $field)
    		{
    			if (stripos($field, 'as') !== FALSE)
    			{
    				$fieldsArray[$key] = preg_split('` as `i', $field);
    				$fieldsArray[$key] = array_map('mb_trim', $fieldsArray[$key]);
    			}
    		}

    		// Quote the identifiers
    		$safeArray = $this->driver->quoteIdent($fieldsArray);

    		unset($fieldsArray);

    		// Join the strings back together
    		foreach ($safeArray as $i => $iValue)
    		{
    			if (is_array($iValue))
    			{
    				$safeArray[$i] = implode(' AS ', $iValue);
    			}
    		}

    		$this->state->appendSelectString(implode(', ', $safeArray));

    		return $this;
    	}

    	/**
    	 * Selects the maximum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectMax(string $field, $as=FALSE): self
    	{
    		// Create the select string
    		$this->state->appendSelectString(' MAX'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * Selects the minimum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectMin(string $field, $as=FALSE): self
    	{
    		// Create the select string
    		$this->state->appendSelectString(' MIN'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * Selects the average value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectAvg(string $field, $as=FALSE): self
    	{
    		// Create the select string
    		$this->state->appendSelectString(' AVG'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * Selects the sum of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectSum(string $field, $as=FALSE): self
    	{
    		// Create the select string
    		$this->state->appendSelectString(' SUM'.$this->_select($field, $as));
    		return $this;
    	}

    	/**
    	 * Add a 'returning' clause to an insert,update, or delete query
    	 *
    	 * @param string $fields
    	 * @return $this
    	 */
    	public function returning(string $fields = ''): self
    	{
    		$this->returning = TRUE;

    		// Re-use the string select field for generating the returning type clause
    		if ($fields !== '')
    		{
    			return $this->select($fields);
    		}

    		return $this;
    	}

    	/**
    	 * Adds the 'distinct' keyword to a query
    	 *
    	 * @return self
    	 */
    	public function distinct(): self
    	{
    		// Prepend the keyword to the select string
    		$this->state->setSelectString(' DISTINCT' . $this->state->getSelectString());
    		return $this;
    	}

    	/**
    	 * Tell the database to give you the query plan instead of result set
    	 *
    	 * @return self
    	 */
    	public function explain(): self
    	{
    		$this->explain = TRUE;
    		return $this;
    	}

    	/**
    	 * Specify the database table to select from
    	 *
    	 * @param string $tblname
    	 * @return self
    	 */
    	public function from(string $tblname): self
    	{
    		// Split identifiers on spaces
    		$identArray = explode(' ', \mb_trim($tblname));
    		$identArray = array_map('\\mb_trim', $identArray);

    		// Quote the identifiers
    		$identArray[0] = $this->driver->quoteTable($identArray[0]);
    		$identArray = $this->driver->quoteIdent($identArray);

    		// Paste it back together
    		$this->state->setFromString(implode(' ', $identArray));

    		return $this;
    	}

    	// --------------------------------------------------------------------------
    	// ! 'Like' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Creates a Like clause in the sql statement
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return self
    	 */
    	public function like(string $field, $val, string $pos='both'): self
    	{
    		return $this->_like($field, $val, $pos);
    	}

    	/**
    	 * Generates an OR Like clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return self
    	 */
    	public function orLike(string $field, $val, string $pos='both'): self
    	{
    		return $this->_like($field, $val, $pos, 'LIKE', 'OR');
    	}

    	/**
    	 * Generates a NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return self
    	 */
    	public function notLike(string $field, $val, string $pos='both'): self
    	{
    		return $this->_like($field, $val, $pos, 'NOT LIKE');
    	}

    	/**
    	 * Generates a OR NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @return self
    	 */
    	public function orNotLike(string $field, $val, string $pos='both'): self
    	{
    		return $this->_like($field, $val, $pos, 'NOT LIKE', 'OR');
    	}

    	// --------------------------------------------------------------------------
    	// ! Having methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Generates a 'Having' clause
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function having($key, $val=[]): self
    	{
    		return $this->_having($key, $val);
    	}

    	/**
    	 * Generates a 'Having' clause prefixed with 'OR'
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function orHaving($key, $val=[]): self
    	{
    		return $this->_having($key, $val, 'OR');
    	}

    	// --------------------------------------------------------------------------
    	// ! 'Where' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Specify condition(s) in the where clause of a query
    	 * Note: this function works with key / value, or a
    	 * passed array with key / value pairs
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @param mixed $escape
    	 * @return self
    	 */
    	public function where($key, $val=[], $escape=NULL): self
    	{
    		return $this->_whereString($key, $val);
    	}

    	/**
    	 * Where clause prefixed with "OR"
    	 *
    	 * @param string $key
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function orWhere($key, $val=[]): self
    	{
    		return $this->_whereString($key, $val, 'OR');
    	}

    	/**
    	 * Where clause with 'IN' statement
    	 *
    	 * @param mixed $field
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function whereIn($field, $val=[]): self
    	{
    		return $this->_whereIn($field, $val);
    	}

    	/**
    	 * Where in statement prefixed with "or"
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function orWhereIn($field, $val=[]): self
    	{
    		return $this->_whereIn($field, $val, 'IN', 'OR');
    	}

    	/**
    	 * WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function whereNotIn($field, $val=[]): self
    	{
    		return $this->_whereIn($field, $val, 'NOT IN');
    	}

    	/**
    	 * OR WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function orWhereNotIn($field, $val=[]): self
    	{
    		return $this->_whereIn($field, $val, 'NOT IN', 'OR');
    	}

    	// --------------------------------------------------------------------------
    	// ! Other Query Modifier methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Sets values for inserts / updates / deletes
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return self
    	 */
    	public function set($key, $val = NULL): self
    	{
    		if (is_scalar($key))
    		{
    			$pairs = [$key => $val];
    		}
    		else
    		{
    			$pairs = $key;
    		}

    		$keys = array_keys($pairs);
    		$values = array_values($pairs);

    		$this->state->appendSetArrayKeys($keys);
    		$this->state->appendValues($values);

    		// Use the keys of the array to make the insert/update string
    		// Escape the field names
    		$this->state->setSetArrayKeys(
    			array_map([$this->driver, '_quote'], $this->state->getSetArrayKeys())
    		);

    		// Generate the "set" string
    		$setString = implode('=?,', $this->state->getSetArrayKeys());
    		$setString .= '=?';

    		$this->state->setSetString($setString);

    		return $this;
    	}

    	/**
    	 * Creates a join phrase in a compiled query
    	 *
    	 * @param string $table
    	 * @param string $condition
    	 * @param string $type
    	 * @return self
    	 */
    	public function join(string $table, string $condition, string $type=''): self
    	{
    		// Prefix and quote table name
    		$tableArr = explode(' ', mb_trim($table));
    		$tableArr[0] = $this->driver->quoteTable($tableArr[0]);
    		$tableArr = $this->driver->quoteIdent($tableArr);
    		$table = implode(' ', $tableArr);

    		// Parse out the join condition
    		$parsedCondition = $this->parser->compileJoin($condition);
    		$condition = $table . ' ON ' . $parsedCondition;

    		$this->state->appendMap("\n" . strtoupper($type) . ' JOIN ', $condition, MapType::JOIN);

    		return $this;
    	}

    	/**
    	 * Group the results by the selected field(s)
    	 *
    	 * @param mixed $field
    	 * @return self
    	 */
    	public function groupBy($field): self
    	{
    		if ( ! is_scalar($field))
    		{
    			$newGroupArray = array_merge(
    				$this->state->getGroupArray(),
    				array_map([$this->driver, 'quoteIdent'], $field)
    			);
    			$this->state->setGroupArray($newGroupArray);
    		}
    		else
    		{
    			$this->state->appendGroupArray($this->driver->quoteIdent($field));
    		}

    		$this->state->setGroupString(' GROUP BY ' . implode(',', $this->state->getGroupArray()));

    		return $this;
    	}

    	/**
    	 * Order the results by the selected field(s)
    	 *
    	 * @param string $field
    	 * @param string $type
    	 * @return self
    	 */
    	public function orderBy(string $field, string $type=''): self
    	{
    		// When ordering by random, do an ascending order if the driver
    		// doesn't support random ordering
    		if (stripos($type, 'rand') !== FALSE)
    		{
    			$rand = $this->driver->getSql()->random();
    			$type = $rand ?? 'ASC';
    		}

    		// Set fields for later manipulation
    		$field = $this->driver->quoteIdent($field);
    		$this->state->setOrderArray($field, $type);

    		$orderClauses = [];

    		// Flatten key/val pairs into an array of space-separated pairs
    		foreach($this->state->getOrderArray() as $k => $v)
    		{
    			$orderClauses[] = $k . ' ' . strtoupper($v);
    		}

    		// Set the final string
    		$orderString =  ! isset($rand)
    			? "\nORDER BY ".implode(', ', $orderClauses)
    			: "\nORDER BY".$rand;

    		$this->state->setOrderString($orderString);

    		return $this;
    	}

    	/**
    	 * Set a limit on the current sql statement
    	 *
    	 * @param int $limit
    	 * @param int|null $offset
    	 * @return self
    	 */
    	public function limit(int $limit, ?int $offset=NULL): self
    	{
    		$this->state->setLimit($limit);
    		$this->state->setOffset($offset);

    		return $this;
    	}

    	// --------------------------------------------------------------------------
    	// ! Query Grouping Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Adds a paren to the current query for query grouping
    	 *
    	 * @return self
    	 */
    	public function groupStart(): self
    	{
    		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' ';

    		$this->state->appendMap($conj, '(', MapType::GROUP_START);

    		return $this;
    	}

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'NOT'
    	 *
    	 * @return self
    	 */
    	public function notGroupStart(): self
    	{
    		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';

    		$this->state->appendMap($conj, ' NOT (', MapType::GROUP_START);

    		return $this;
    	}

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR'
    	 *
    	 * @return self
    	 */
    	public function orGroupStart(): self
    	{
    		$this->state->appendMap('', ' OR (', MapType::GROUP_START);

    		return $this;
    	}

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR NOT'
    	 *
    	 * @return self
    	 */
    	public function orNotGroupStart(): self
    	{
    		$this->state->appendMap('', ' OR NOT (', MapType::GROUP_START);

    		return $this;
    	}

    	/**
    	 * Ends a query group
    	 *
    	 * @return self
    	 */
    	public function groupEnd(): self
    	{
    		$this->state->appendMap('', ')', MapType::GROUP_END);

    		return $this;
    	}

    	// --------------------------------------------------------------------------
    	// ! Query execution methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Select and retrieve all records from the current table, and/or
    	 * execute current compiled query
    	 *
    	 * @param string $table
    	 * @param int|null $limit
    	 * @param int|null $offset
    	 * @return PDOStatement
    	 */
    	public function get(string $table='', ?int $limit=NULL, ?int $offset=NULL): PDOStatement
    	{
    		// Set the table
    		if ( ! empty($table))
    		{
    			$this->from($table);
    		}

    		// Set the limit, if it exists
    		if (is_int($limit))
    		{
    			$this->limit($limit, $offset);
    		}

    		return $this->_run('get', $table);
    	}

    	/**
    	 * Convenience method for get() with a where clause
    	 *
    	 * @param string $table
    	 * @param mixed $where
    	 * @param int|null $limit
    	 * @param int|null $offset
    	 * @return PDOStatement
    	 */
    	public function getWhere(string $table, $where=[], ?int $limit=NULL, ?int $offset=NULL): PDOStatement
    	{
    		// Create the where clause
    		$this->where($where);

    		// Return the result
    		return $this->get($table, $limit, $offset);
    	}

    	/**
    	 * Retrieve the number of rows in the selected table
    	 *
    	 * @param string $table
    	 * @return int
    	 */
    	public function countAll(string $table): int
    	{
    		$sql = 'SELECT * FROM '.$this->driver->quoteTable($table);
    		$res = $this->driver->query($sql);
    		return (int) count($res->fetchAll());
    	}

    	/**
    	 * Retrieve the number of results for the generated query - used
    	 * in place of the get() method
    	 *
    	 * @param string $table
    	 * @param boolean $reset
    	 * @return int
    	 */
    	public function countAllResults(string $table='', bool $reset = TRUE): int
    	{
    		// Set the table
    		if ( ! empty($table))
    		{
    			$this->from($table);
    		}

    		$result = $this->_run(QueryType::SELECT, $table, NULL, NULL, $reset);
    		$rows = $result->fetchAll();

    		return (int) count($rows);
    	}

    	/**
    	 * Creates an insert clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function insert(string $table, $data=[]): PDOStatement
    	{
    		if ( ! empty($data))
    		{
    			$this->set($data);
    		}

    		return $this->_run(QueryType::INSERT, $table);
    	}

    	/**
    	 * Creates and executes a batch insertion query
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @return PDOStatement
    	 */
    	public function insertBatch(string $table, $data=[]): ?PDOStatement
    	{
    		// Get the generated values and sql string
    		[$sql, $data] = $this->driver->insertBatch($table, $data);

    		return $sql !== NULL
    			? $this->_run('', $table, $sql, $data)
    			: NULL;
    	}

    	/**
    	 * Creates an update clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function update(string $table, $data=[]): PDOStatement
    	{
    		if ( ! empty($data))
    		{
    			$this->set($data);
    		}

    		return $this->_run(QueryType::UPDATE, $table);
    	}

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @param string $where
    	 * @return int|null
    	 */
    	public function updateBatch(string $table, array $data, string $where): ?int
    	{
    		if (empty($table) || empty($data) || empty($where))
    		{
    			return NULL;
    		}

    		// Get the generated values and sql string
    		[$sql, $data, $affectedRows] = $this->driver->updateBatch($table, $data, $where);

    		$this->_run('', $table, $sql, $data);
    		return $affectedRows;
    	}

    	/**
    	 * Deletes data from a table
    	 *
    	 * @param string $table
    	 * @param mixed $where
    	 * @return PDOStatement
    	 */
    	public function delete(string $table, $where=''): PDOStatement
    	{
    		// Set the where clause
    		if ( ! empty($where))
    		{
    			$this->where($where);
    		}

    		return $this->_run(QueryType::DELETE, $table);
    	}

    	// --------------------------------------------------------------------------
    	// ! SQL Returning Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Returns the generated 'select' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledSelect(string $table='', bool $reset=TRUE): string
    	{
    		// Set the table
    		if ( ! empty($table))
    		{
    			$this->from($table);
    		}

    		return $this->_getCompile(QueryType::SELECT, $table, $reset);
    	}

    	/**
    	 * Returns the generated 'insert' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledInsert(string $table, bool $reset=TRUE): string
    	{
    		return $this->_getCompile(QueryType::INSERT, $table, $reset);
    	}

    	/**
    	 * Returns the generated 'update' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledUpdate(string $table='', bool $reset=TRUE): string
    	{
    		return $this->_getCompile(QueryType::UPDATE, $table, $reset);
    	}

    	/**
    	 * Returns the generated 'delete' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledDelete(string $table='', bool $reset=TRUE): string
    	{
    		return $this->_getCompile(QueryType::DELETE, $table, $reset);
    	}
    }

    diff --git a/apiDocumentation/source/QueryBuilderBase.php.html b/apiDocumentation/source/QueryBuilderBase.php.html new file mode 100644 index 0000000..346e7e1 --- /dev/null +++ b/apiDocumentation/source/QueryBuilderBase.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of QueryBuilderBase.php

    Source of file QueryBuilderBase.php

    + Size: 14,191 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/QueryBuilderBase.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    use function regexInArray;

    use BadMethodCallException;
    use PDO;
    use PDOStatement;
    use Query\Drivers\DriverInterface;

    /**
     * @method affectedRows(): int
     * @method beginTransaction(): bool
     * @method commit(): bool
     * @method errorCode(): string
     * @method errorInfo(): array
     * @method exec(string $statement): int
     * @method getAttribute(int $attribute)
     * @method getColumns(string $table): array | null
     * @method getDbs(): array | null
     * @method getFks(string $table): array | null
     * @method getFunctions(): array | null
     * @method getIndexes(string $table): array | null
     * @method getLastQuery(): string
     * @method getProcedures(): array | null
     * @method getSchemas(): array | null
     * @method getSequences(): array | null
     * @method getSystemTables(): array | null
     * @method getTables(): array
     * @method getTriggers(): array | null
     * @method getTypes(): array | null
     * @method getUtil(): \Query\Drivers\AbstractUtil
     * @method getVersion(): string
     * @method getViews(): array | null
     * @method inTransaction(): bool
     * @method lastInsertId(string $name = NULL): string
     * @method numRows(): int | null
     * @method prepare(string $statement, array $driver_options = []): PDOStatement
     * @method prepareExecute(string $sql, array $params): PDOStatement
     * @method prepareQuery(string $sql, array $data): PDOStatement
     * @method query(string $statement): PDOStatement
     * @method quote(string $string, int $parameter_type = PDO::PARAM_STR): string
     * @method rollback(): bool
     * @method setAttribute(int $attribute, $value): bool
     * @method setTablePrefix(string $prefix): void
     * @method truncate(string $table): PDOStatement
     */
    class QueryBuilderBase {

    	/**
    	 * Convenience property for connection management
    	 * @var string
    	 */
    	public string $connName = '';

    	/**
    	 * List of queries executed
    	 * @var array
    	 */
    	public array $queries = [
    		'total_time' => 0
    	];

    	/**
    	 * Whether to do only an explain on the query
    	 * @var bool
    	 */
    	protected bool $explain = FALSE;

    	/**
    	 * Whether to return data from a modification query
    	 * @var bool
    	 */
    	protected bool $returning = FALSE;

    	/**
    	 * The current database driver
    	 * @var DriverInterface
    	 */
    	protected ?DriverInterface $driver;

    	/**
    	 * Query parser class instance
    	 * @var QueryParser
    	 */
    	protected QueryParser $parser;

    	/**
    	 * Query Builder state
    	 * @var State
    	 */
    	protected State $state;

    	// --------------------------------------------------------------------------
    	// ! Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Constructor
    	 *
    	 * @param DriverInterface $driver
    	 * @param QueryParser $parser
    	 */
    	public function __construct(DriverInterface $driver, QueryParser $parser)
    	{
    		// Inject driver and parser
    		$this->driver = $driver;
    		$this->parser = $parser;

    		// Create new State object
    		$this->state = new State();
    	}

    	/**
    	 * Destructor
    	 * @codeCoverageIgnore
    	 */
    	public function __destruct()
    	{
    		$this->driver = NULL;
    	}

    	/**
    	 * Calls a function further down the inheritance chain.
    	 * 'Implements' methods on the driver object
    	 *
    	 * @param string $name
    	 * @param array $params
    	 * @return mixed
    	 * @throws BadMethodCallException
    	 */
    	public function __call(string $name, array $params)
    	{
    		if (method_exists($this->driver, $name))
    		{
    			return $this->driver->$name(...$params);
    		}

    		throw new BadMethodCallException('Method does not exist');
    	}

    	/**
    	 * Clear out the class variables, so the next query can be run
    	 *
    	 * @return void
    	 */
    	public function resetQuery(): void
    	{
    		$this->state = new State();
    		$this->explain = FALSE;
    		$this->returning = FALSE;
    	}

    	/**
    	 * Method to simplify select_ methods
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return string
    	 */
    	protected function _select(string $field, $as = FALSE): string
    	{
    		// Escape the identifiers
    		$field = $this->driver->quoteIdent($field);

    		if ( ! \is_string($as))
    		{
    			// @codeCoverageIgnoreStart
    			return $field;
    			// @codeCoverageIgnoreEnd
    		}

    		$as = $this->driver->quoteIdent($as);
    		return "({$field}) AS {$as} ";
    	}

    	/**
    	 * Helper function for returning sql strings
    	 *
    	 * @param string $type
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	protected function _getCompile(string $type, string $table, bool $reset): string
    	{
    		$sql = $this->_compile($type, $table);

    		// Reset the query builder for the next query
    		if ($reset)
    		{
    			$this->resetQuery();
    		}

    		return $sql;
    	}

    	/**
    	 * Simplify 'like' methods
    	 *
    	 * @param string $field
    	 * @param mixed $val
    	 * @param string $pos
    	 * @param string $like
    	 * @param string $conj
    	 * @return self
    	 */
    	protected function _like(string $field, $val, string $pos, string $like = 'LIKE', string $conj = 'AND'): self
    	{
    		$field = $this->driver->quoteIdent($field);

    		// Add the like string into the order map
    		$like = $field . " {$like} ?";

    		if ($pos === 'before')
    		{
    			$val = "%{$val}";
    		} elseif ($pos === 'after')
    		{
    			$val = "{$val}%";
    		} else
    		{
    			$val = "%{$val}%";
    		}

    		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
    		$this->state->appendMap($conj, $like, MapType::LIKE);

    		// Add to the values array
    		$this->state->appendWhereValues($val);

    		return $this;
    	}

    	/**
    	 * Simplify building having clauses
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @param string $conj
    	 * @return self
    	 */
    	protected function _having($key, $values = [], string $conj = 'AND'): self
    	{
    		$where = $this->_where($key, $values);

    		// Create key/value placeholders
    		foreach ($where as $f => $val)
    		{
    			// Split each key by spaces, in case there
    			// is an operator such as >, <, !=, etc.
    			$fArray = explode(' ', trim($f));

    			$item = $this->driver->quoteIdent($fArray[0]);

    			// Simple key value, or an operator
    			$item .= (count($fArray) === 1) ? '=?' : " {$fArray[1]} ?";

    			// Put in the having map
    			$this->state->appendHavingMap([
    				'conjunction' => empty($this->state->getHavingMap())
    					? ' HAVING '
    					: " {$conj} ",
    				'string' => $item
    			]);
    		}

    		return $this;
    	}

    	/**
    	 * Do all the redundant stuff for where/having type methods
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @return array
    	 */
    	protected function _where($key, $val = []): array
    	{
    		$where = [];
    		$pairs = [];

    		if (is_scalar($key))
    		{
    			$pairs[$key] = $val;
    		} else
    		{
    			$pairs = $key;
    		}

    		foreach ($pairs as $k => $v)
    		{
    			$where[$k] = $v;
    			$this->state->appendWhereValues($v);
    		}

    		return $where;
    	}

    	/**
    	 * Simplify generating where string
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @param string $defaultConj
    	 * @return self
    	 */
    	protected function _whereString($key, $values = [], string $defaultConj = 'AND'): self
    	{
    		// Create key/value placeholders
    		foreach ($this->_where($key, $values) as $f => $val)
    		{
    			$queryMap = $this->state->getQueryMap();

    			// Split each key by spaces, in case there
    			// is an operator such as >, <, !=, etc.
    			$fArray = explode(' ', trim($f));

    			$item = $this->driver->quoteIdent($fArray[0]);

    			// Simple key value, or an operator
    			$item .= (count($fArray) === 1) ? '=?' : " {$fArray[1]} ?";
    			$lastItem = end($queryMap);

    			// Determine the correct conjunction
    			$conjunctionList = array_column($queryMap, 'conjunction');
    			if (empty($queryMap) || ( ! regexInArray($conjunctionList, "/^ ?\n?WHERE/i")))
    			{
    				$conj = "\nWHERE ";
    			} elseif ($lastItem['type'] === 'group_start')
    			{
    				$conj = '';
    			} else
    			{
    				$conj = " {$defaultConj} ";
    			}

    			$this->state->appendMap($conj, $item, MapType::WHERE);
    		}

    		return $this;
    	}

    	/**
    	 * Simplify where_in methods
    	 *
    	 * @param mixed $key
    	 * @param mixed $val
    	 * @param string $in - The (not) in fragment
    	 * @param string $conj - The where in conjunction
    	 * @return self
    	 */
    	protected function _whereIn($key, $val = [], string $in = 'IN', string $conj = 'AND'): self
    	{
    		$key = $this->driver->quoteIdent($key);
    		$params = array_fill(0, count($val), '?');
    		$this->state->appendWhereValues($val);

    		$conjunction = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
    		$str = $key . " {$in} (" . implode(',', $params) . ') ';

    		$this->state->appendMap($conjunction, $str, MapType::WHERE_IN);

    		return $this;
    	}

    	/**
    	 * Executes the compiled query
    	 *
    	 * @param string $type
    	 * @param string $table
    	 * @param string $sql
    	 * @param array|null $vals
    	 * @param boolean $reset
    	 * @return PDOStatement
    	 */
    	protected function _run(string $type, string $table, string $sql = NULL, array $vals = NULL, bool $reset = TRUE): PDOStatement
    	{
    		if ($sql === NULL)
    		{
    			$sql = $this->_compile($type, $table);
    		}

    		if ($vals === NULL)
    		{
    			$vals = array_merge($this->state->getValues(), $this->state->getWhereValues());
    		}

    		$startTime = microtime(TRUE);

    		$res = empty($vals)
    			? $this->driver->query($sql)
    			: $this->driver->prepareExecute($sql, $vals);

    		$endTime = microtime(TRUE);
    		$totalTime = number_format($endTime - $startTime, 5);

    		// Add this query to the list of executed queries
    		$this->_appendQuery($vals, $sql, (int)$totalTime);

    		// Reset class state for next query
    		if ($reset)
    		{
    			$this->resetQuery();
    		}

    		return $res;
    	}

    	/**
    	 * Convert the prepared statement into readable sql
    	 *
    	 * @param array $values
    	 * @param string $sql
    	 * @param int $totalTime
    	 * @return void
    	 */
    	protected function _appendQuery(array $values, string $sql, int $totalTime): void
    	{
    		$evals = is_array($values) ? $values : [];
    		$esql = str_replace('?', '%s', $sql);

    		// Quote string values
    		foreach ($evals as &$v)
    		{
    			$v = ( ! is_numeric($v))
    				? htmlentities($this->driver->quote($v), ENT_NOQUOTES, 'utf-8')
    				: $v;
    		}
    		unset($v);

    		// Add the query onto the array of values to pass
    		// as arguments to sprintf
    		array_unshift($evals, $esql);

    		// Add the interpreted query to the list of executed queries
    		$this->queries[] = [
    			'time' => $totalTime,
    			'sql' => sprintf(...$evals)
    		];

    		$this->queries['total_time'] += $totalTime;

    		// Set the last query to get rowcounts properly
    		$this->driver->setLastQuery($sql);
    	}

    	/**
    	 * Sub-method for generating sql strings
    	 *
    	 * @codeCoverageIgnore
    	 * @param string $type
    	 * @param string $table
    	 * @return string
    	 */
    	protected function _compileType(string $type = QueryType::SELECT, string $table = ''): string
    	{
    		$setArrayKeys = $this->state->getSetArrayKeys();
    		switch ($type)
    		{
    			case QueryType::INSERT:
    				$paramCount = count($setArrayKeys);
    				$params = array_fill(0, $paramCount, '?');
    				$sql = "INSERT INTO {$table} ("
    					. implode(',', $setArrayKeys)
    					. ")\nVALUES (" . implode(',', $params) . ')';
    				break;

    			case QueryType::UPDATE:
    				$setString = $this->state->getSetString();
    				$sql = "UPDATE {$table}\nSET {$setString}";
    				break;

    			case QueryType::DELETE:
    				$sql = "DELETE FROM {$table}";
    				break;

    			case QueryType::SELECT:
    			default:
    				$fromString = $this->state->getFromString();
    				$selectString = $this->state->getSelectString();

    				$sql = "SELECT * \nFROM {$fromString}";

    				// Set the select string
    				if ( ! empty($selectString))
    				{
    					// Replace the star with the selected fields
    					$sql = str_replace('*', $selectString, $sql);
    				}
    				break;
    		}

    		return $sql;
    	}

    	/**
    	 * String together the sql statements for sending to the db
    	 *
    	 * @param string $type
    	 * @param string $table
    	 * @return string
    	 */
    	protected function _compile(string $type = '', string $table = ''): string
    	{
    		// Get the base clause for the query
    		$sql = $this->_compileType($type, $this->driver->quoteTable($table));

    		$clauses = [
    			'queryMap',
    			'groupString',
    			'orderString',
    			'havingMap',
    		];

    		// Set each type of subclause
    		foreach ($clauses as $clause)
    		{
    			$func = 'get' . ucFirst($clause);
    			$param = $this->state->$func();
    			if (is_array($param))
    			{
    				foreach ($param as $q)
    				{
    					$sql .= $q['conjunction'] . $q['string'];
    				}
    			} else
    			{
    				$sql .= $param;
    			}
    		}

    		// Set the limit via the class variables
    		$limit = $this->state->getLimit();
    		if (is_numeric($limit))
    		{
    			$sql = $this->driver->getSql()->limit($sql, $limit, $this->state->getOffset());
    		}

    		// Set the returning clause, if applicable
    		$sql = $this->_compileReturning($sql, $type);

    		// See if the query plan, rather than the
    		// query data should be returned
    		if ($this->explain === TRUE)
    		{
    			$sql = $this->driver->getSql()->explain($sql);
    		}

    		return $sql;
    	}

    	/**
    	 * Generate returning clause of query
    	 *
    	 * @param string $sql
    	 * @param string $type
    	 * @return string
    	 */
    	protected function _compileReturning(string $sql, string $type): string
    	{
    		if ($this->returning === FALSE)
    		{
    			return $sql;
    		}

    		$rawSelect = $this->state->getSelectString();
    		$selectString = ($rawSelect === '') ? '*' : $rawSelect;
    		$returningSQL = $this->driver->returning($sql, $selectString);

    		if ($returningSQL === $sql)
    		{
    			// If the driver doesn't support the returning clause, it returns the original query.
    			// Fake the same result with a transaction and a select query
    			if ( ! $this->inTransaction())
    			{
    				$this->beginTransaction();
    			}

    			// Generate the appropriate select query for the returning clause fallback
    			switch ($type)
    			{
    				case QueryType::INSERT:
    					// @TODO figure out a good response for insert query
    					break;

    				case QueryType::UPDATE:
    					// @TODO figure out a good response for update query
    					break;

    				case QueryType::INSERT_BATCH:
    				case QueryType::UPDATE_BATCH:
    					// @TODO figure out a good response for batch queries
    					break;

    				default:
    					// On Delete queries, what would we return?
    					break;
    			}
    		}

    		return $returningSQL;
    	}
    }
    diff --git a/apiDocumentation/source/QueryBuilderInterface.php.html b/apiDocumentation/source/QueryBuilderInterface.php.html index d58391f..b9b2593 100644 --- a/apiDocumentation/source/QueryBuilderInterface.php.html +++ b/apiDocumentation/source/QueryBuilderInterface.php.html @@ -1,3 +1,3 @@ phpDox - Source of QueryBuilderInterface.php

    Source of file QueryBuilderInterface.php

    - Size: 12,142 Bytes - Last Modified: 2019-12-11T16:12:08-05:00

    src/QueryBuilderInterface.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query;

    use PDO;
    use PDOStatement;

    /**
     * Interface defining the Query Builder class
     *
     * @method affectedRows(): int
     * @method beginTransaction(): bool
     * @method commit(): bool
     * @method errorCode(): string
     * @method errorInfo(): array
     * @method exec(string $statement): int
     * @method getAttribute(int $attribute)
     * @method getColumns(string $table): array | null
     * @method getDbs(): array | null
     * @method getFks(string $table): array | null
     * @method getFunctions(): array | null
     * @method getIndexes(string $table): array | null
     * @method getLastQuery(): string
     * @method getProcedures(): array | null
     * @method getSchemas(): array | null
     * @method getSequences(): array | null
     * @method getSystemTables(): array | null
     * @method getTables(): array
     * @method getTriggers(): array | null
     * @method getTypes(): array | null
     * @method getUtil(): \Query\Drivers\AbstractUtil
     * @method getViews(): array | null
     * @method inTransaction(): bool
     * @method lastInsertId(string $name = NULL): string
     * @method numRows(): int | null
     * @method prepare(string $statement, array $driver_options = []): PDOStatement
     * @method prepareExecute(string $sql, array $params): PDOStatement
     * @method prepareQuery(string $sql, array $data): PDOStatement
     * @method query(string $statement): PDOStatement
     * @method quote(string $string, int $parameter_type = PDO::PARAM_STR): string
     * @method rollback(): bool
     * @method setAttribute(int $attribute, $value): bool
     * @method setTablePrefix(string $prefix): void
     * @method truncate(string $table): PDOStatement
     */
    interface QueryBuilderInterface {

    	// --------------------------------------------------------------------------
    	// ! Select Queries
    	// --------------------------------------------------------------------------

    	/**
    	 * Specifies rows to select in a query
    	 *
    	 * @param string $fields
    	 * @return self
    	 */
    	public function select(string $fields): self;

    	/**
    	 * Selects the maximum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectMax(string $field, $as=FALSE): self;

    	/**
    	 * Selects the minimum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectMin(string $field, $as=FALSE): self;

    	/**
    	 * Selects the average value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectAvg(string $field, $as=FALSE): self;

    	/**
    	 * Selects the sum of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectSum(string $field, $as=FALSE): self;

    	/**
    	 * Adds the 'distinct' keyword to a query
    	 *
    	 * @return self
    	 */
    	public function distinct(): self;

    	/**
    	 * Shows the query plan for the query
    	 *
    	 * @return self
    	 */
    	public function explain(): self;

    	/**
    	 * Specify the database table to select from
    	 *
    	 * @param string $tblname
    	 * @return self
    	 */
    	public function from(string $tblname): self;

    	// --------------------------------------------------------------------------
    	// ! 'Like' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Creates a Like clause in the sql statement
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function like(string $field, $values, string $pos='both'): self;

    	/**
    	 * Generates an OR Like clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function orLike(string $field, $values, string $pos='both'): self;

    	/**
    	 * Generates a NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function notLike(string $field, $values, string $pos='both'): self;

    	/**
    	 * Generates a OR NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function orNotLike(string $field, $values, string $pos='both'): self;

    	// --------------------------------------------------------------------------
    	// ! Having methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Generates a 'Having' clause
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function having($key, $values=[]): self;

    	/**
    	 * Generates a 'Having' clause prefixed with 'OR'
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orHaving($key, $values=[]): self;

    	// --------------------------------------------------------------------------
    	// ! 'Where' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Specify condition(s) in the where clause of a query
    	 * Note: this function works with key / value, or a
    	 * passed array with key / value pairs
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @param bool $escape
    	 * @return self
    	 */
    	public function where($key, $values=[], $escape = NULL): self;

    	/**
    	 * Where clause prefixed with "OR"
    	 *
    	 * @param string $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orWhere($key, $values=[]): self;

    	/**
    	 * Where clause with 'IN' statement
    	 *
    	 * @param mixed $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function whereIn($field, $values=[]): self;

    	/**
    	 * Where in statement prefixed with "or"
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orWhereIn($field, $values=[]): self;

    	/**
    	 * WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function whereNotIn($field, $values=[]): self;

    	/**
    	 * OR WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orWhereNotIn($field, $values=[]): self;

    	// --------------------------------------------------------------------------
    	// ! Other Query Modifier methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Sets values for inserts / updates / deletes
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function set($key, $values = NULL): self;

    	/**
    	 * Creates a join phrase in a compiled query
    	 *
    	 * @param string $table
    	 * @param string $condition
    	 * @param string $type
    	 * @return self
    	 */
    	public function join(string $table, string $condition, string $type=''): self;

    	/**
    	 * Group the results by the selected field(s)
    	 *
    	 * @param mixed $field
    	 * @return self
    	 */
    	public function groupBy($field): self;

    	/**
    	 * Order the results by the selected field(s)
    	 *
    	 * @param string $field
    	 * @param string $type
    	 * @return self
    	 */
    	public function orderBy(string $field, string $type=''): self;

    	/**
    	 * Set a limit on the current sql statement
    	 *
    	 * @param int $limit
    	 * @param int|bool $offset
    	 * @return self
    	 */
    	public function limit(int $limit, $offset=FALSE): self;

    	// --------------------------------------------------------------------------
    	// ! Query Grouping Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Adds a paren to the current query for query grouping
    	 *
    	 * @return self
    	 */
    	public function groupStart(): self;

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'NOT'
    	 *
    	 * @return self
    	 */
    	public function notGroupStart(): self;

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR'
    	 *
    	 * @return self
    	 */
    	public function orGroupStart(): self;

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR NOT'
    	 *
    	 * @return self
    	 */
    	public function orNotGroupStart(): self;

    	/**
    	 * Ends a query group
    	 *
    	 * @return self
    	 */
    	public function groupEnd(): self;

    	// --------------------------------------------------------------------------
    	// ! Query execution methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Select and retrieve all records from the current table, and/or
    	 * execute current compiled query
    	 *
    	 * @param string $table
    	 * @param int|bool $limit
    	 * @param int|bool $offset
    	 * @return PDOStatement
    	 */
    	public function get(string $table='', $limit=FALSE, $offset=FALSE): PDOStatement;

    	/**
    	 * Convenience method for get() with a where clause
    	 *
    	 * @param string $table
    	 * @param array $where
    	 * @param int|bool $limit
    	 * @param int|bool $offset
    	 * @return PDOStatement
    	 */
    	public function getWhere(string $table, $where=[], $limit=FALSE, $offset=FALSE): PDOStatement;

    	/**
    	 * Retrieve the number of rows in the selected table
    	 *
    	 * @param string $table
    	 * @return int
    	 */
    	public function countAll(string $table): int;

    	/**
    	 * Retrieve the number of results for the generated query - used
    	 * in place of the get() method
    	 *
    	 * @param string $table
    	 * @param bool $reset - Whether to keep the query after counting the results
    	 * @return int
    	 */
    	public function countAllResults(string $table='', bool $reset=TRUE): int;

    	/**
    	 * Creates an insert clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function insert(string $table, $data=[]): PDOStatement;

    	/**
    	 * Creates and executes a batch insertion query
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @return PDOStatement
    	 */
    	public function insertBatch(string $table, $data=[]): PDOStatement;

    	/**
    	 * Creates an update clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function update(string $table, $data=[]): PDOStatement;

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table The table to update
    	 * @param array $data an array of update values
    	 * @param string $where The where key
    	 * @return int|null
    	 */
    	public function updateBatch(string $table, array $data, string $where): ?int;

    	/**
    	 * Deletes data from a table
    	 *
    	 * @param string $table
    	 * @param mixed $where
    	 * @return PDOStatement
    	 */
    	public function delete(string $table, $where=''): PDOStatement;

    	// --------------------------------------------------------------------------
    	// ! SQL Returning Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Returns the generated 'select' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledSelect(string $table='', bool $reset=TRUE): string;

    	/**
    	 * Returns the generated 'insert' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledInsert(string $table, bool $reset=TRUE): string;

    	/**
    	 * Returns the generated 'update' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledUpdate(string $table='', bool $reset=TRUE): string;

    	/**
    	 * Returns the generated 'delete' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledDelete(string $table='', bool $reset=TRUE): string;

    	// --------------------------------------------------------------------------
    	// ! Miscellaneous Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Clear out the class variables, so the next query can be run
    	 *
    	 * @return void
    	 */
    	public function resetQuery(): void;
    }

    // End of QueryBuilderInterface.php

    + Size: 12,220 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/QueryBuilderInterface.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    use PDO;
    use PDOStatement;

    /**
     * Interface defining the Query Builder class
     *
     * @method affectedRows(): int
     * @method beginTransaction(): bool
     * @method commit(): bool
     * @method errorCode(): string
     * @method errorInfo(): array
     * @method exec(string $statement): int
     * @method getAttribute(int $attribute)
     * @method getColumns(string $table): array | null
     * @method getDbs(): array | null
     * @method getFks(string $table): array | null
     * @method getFunctions(): array | null
     * @method getIndexes(string $table): array | null
     * @method getLastQuery(): string
     * @method getProcedures(): array | null
     * @method getSchemas(): array | null
     * @method getSequences(): array | null
     * @method getSystemTables(): array | null
     * @method getTables(): array
     * @method getTriggers(): array | null
     * @method getTypes(): array | null
     * @method getUtil(): \Query\Drivers\AbstractUtil
     * @method getVersion(): string
     * @method getViews(): array | null
     * @method inTransaction(): bool
     * @method lastInsertId(string $name = NULL): string
     * @method numRows(): int | null
     * @method prepare(string $statement, array $driver_options = []): PDOStatement
     * @method prepareExecute(string $sql, array $params): PDOStatement
     * @method prepareQuery(string $sql, array $data): PDOStatement
     * @method query(string $statement): PDOStatement
     * @method quote(string $string, int $parameter_type = PDO::PARAM_STR): string
     * @method rollback(): bool
     * @method setAttribute(int $attribute, $value): bool
     * @method setTablePrefix(string $prefix): void
     * @method truncate(string $table): PDOStatement
     */
    interface QueryBuilderInterface {

    	// --------------------------------------------------------------------------
    	// ! Select Queries
    	// --------------------------------------------------------------------------

    	/**
    	 * Specifies rows to select in a query
    	 *
    	 * @param string $fields
    	 * @return self
    	 */
    	public function select(string $fields): self;

    	/**
    	 * Selects the maximum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectMax(string $field, $as=FALSE): self;

    	/**
    	 * Selects the minimum value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectMin(string $field, $as=FALSE): self;

    	/**
    	 * Selects the average value of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectAvg(string $field, $as=FALSE): self;

    	/**
    	 * Selects the sum of a field from a query
    	 *
    	 * @param string $field
    	 * @param string|bool $as
    	 * @return self
    	 */
    	public function selectSum(string $field, $as=FALSE): self;

    	/**
    	 * Adds the 'distinct' keyword to a query
    	 *
    	 * @return self
    	 */
    	public function distinct(): self;

    	/**
    	 * Shows the query plan for the query
    	 *
    	 * @return self
    	 */
    	public function explain(): self;

    	/**
    	 * Specify the database table to select from
    	 *
    	 * @param string $tblname
    	 * @return self
    	 */
    	public function from(string $tblname): self;

    	// --------------------------------------------------------------------------
    	// ! 'Like' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Creates a Like clause in the sql statement
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function like(string $field, $values, string $pos='both'): self;

    	/**
    	 * Generates an OR Like clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function orLike(string $field, $values, string $pos='both'): self;

    	/**
    	 * Generates a NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function notLike(string $field, $values, string $pos='both'): self;

    	/**
    	 * Generates a OR NOT LIKE clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @param string $pos
    	 * @return self
    	 */
    	public function orNotLike(string $field, $values, string $pos='both'): self;

    	// --------------------------------------------------------------------------
    	// ! Having methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Generates a 'Having' clause
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function having($key, $values=[]): self;

    	/**
    	 * Generates a 'Having' clause prefixed with 'OR'
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orHaving($key, $values=[]): self;

    	// --------------------------------------------------------------------------
    	// ! 'Where' methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Specify condition(s) in the where clause of a query
    	 * Note: this function works with key / value, or a
    	 * passed array with key / value pairs
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @param bool $escape
    	 * @return self
    	 */
    	public function where($key, $values=[], $escape = NULL): self;

    	/**
    	 * Where clause prefixed with "OR"
    	 *
    	 * @param string $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orWhere($key, $values=[]): self;

    	/**
    	 * Where clause with 'IN' statement
    	 *
    	 * @param mixed $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function whereIn($field, $values=[]): self;

    	/**
    	 * Where in statement prefixed with "or"
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orWhereIn($field, $values=[]): self;

    	/**
    	 * WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function whereNotIn($field, $values=[]): self;

    	/**
    	 * OR WHERE NOT IN (FOO) clause
    	 *
    	 * @param string $field
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function orWhereNotIn($field, $values=[]): self;

    	// --------------------------------------------------------------------------
    	// ! Other Query Modifier methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Sets values for inserts / updates / deletes
    	 *
    	 * @param mixed $key
    	 * @param mixed $values
    	 * @return self
    	 */
    	public function set($key, $values = NULL): self;

    	/**
    	 * Creates a join phrase in a compiled query
    	 *
    	 * @param string $table
    	 * @param string $condition
    	 * @param string $type
    	 * @return self
    	 */
    	public function join(string $table, string $condition, string $type=''): self;

    	/**
    	 * Group the results by the selected field(s)
    	 *
    	 * @param mixed $field
    	 * @return self
    	 */
    	public function groupBy($field): self;

    	/**
    	 * Order the results by the selected field(s)
    	 *
    	 * @param string $field
    	 * @param string $type
    	 * @return self
    	 */
    	public function orderBy(string $field, string $type=''): self;

    	/**
    	 * Set a limit on the current sql statement
    	 *
    	 * @param int $limit
    	 * @param int|null $offset
    	 * @return self
    	 */
    	public function limit(int $limit, ?int $offset=NULL): self;

    	// --------------------------------------------------------------------------
    	// ! Query Grouping Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Adds a paren to the current query for query grouping
    	 *
    	 * @return self
    	 */
    	public function groupStart(): self;

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'NOT'
    	 *
    	 * @return self
    	 */
    	public function notGroupStart(): self;

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR'
    	 *
    	 * @return self
    	 */
    	public function orGroupStart(): self;

    	/**
    	 * Adds a paren to the current query for query grouping,
    	 * prefixed with 'OR NOT'
    	 *
    	 * @return self
    	 */
    	public function orNotGroupStart(): self;

    	/**
    	 * Ends a query group
    	 *
    	 * @return self
    	 */
    	public function groupEnd(): self;

    	// --------------------------------------------------------------------------
    	// ! Query execution methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Select and retrieve all records from the current table, and/or
    	 * execute current compiled query
    	 *
    	 * @param string $table
    	 * @param int|null $limit
    	 * @param int|null $offset
    	 * @return PDOStatement
    	 */
    	public function get(string $table='', ?int $limit=NULL, ?int $offset=NULL): PDOStatement;

    	/**
    	 * Convenience method for get() with a where clause
    	 *
    	 * @param string $table
    	 * @param array $where
    	 * @param int|null $limit
    	 * @param int|null $offset
    	 * @return PDOStatement
    	 */
    	public function getWhere(string $table, $where=[], ?int $limit=NULL, ?int $offset=NULL): PDOStatement;

    	/**
    	 * Retrieve the number of rows in the selected table
    	 *
    	 * @param string $table
    	 * @return int
    	 */
    	public function countAll(string $table): int;

    	/**
    	 * Retrieve the number of results for the generated query - used
    	 * in place of the get() method
    	 *
    	 * @param string $table
    	 * @param bool $reset - Whether to keep the query after counting the results
    	 * @return int
    	 */
    	public function countAllResults(string $table='', bool $reset=TRUE): int;

    	/**
    	 * Creates an insert clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function insert(string $table, $data=[]): PDOStatement;

    	/**
    	 * Creates and executes a batch insertion query
    	 *
    	 * @param string $table
    	 * @param array $data
    	 * @return PDOStatement | null
    	 */
    	public function insertBatch(string $table, $data=[]): ?PDOStatement;

    	/**
    	 * Creates an update clause, and executes it
    	 *
    	 * @param string $table
    	 * @param mixed $data
    	 * @return PDOStatement
    	 */
    	public function update(string $table, $data=[]): PDOStatement;

    	/**
    	 * Creates a batch update, and executes it.
    	 * Returns the number of affected rows
    	 *
    	 * @param string $table The table to update
    	 * @param array $data an array of update values
    	 * @param string $where The where key
    	 * @return int|null
    	 */
    	public function updateBatch(string $table, array $data, string $where): ?int;

    	/**
    	 * Deletes data from a table
    	 *
    	 * @param string $table
    	 * @param mixed $where
    	 * @return PDOStatement
    	 */
    	public function delete(string $table, $where=''): PDOStatement;

    	// --------------------------------------------------------------------------
    	// ! SQL Returning Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Returns the generated 'select' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledSelect(string $table='', bool $reset=TRUE): string;

    	/**
    	 * Returns the generated 'insert' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledInsert(string $table, bool $reset=TRUE): string;

    	/**
    	 * Returns the generated 'update' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledUpdate(string $table='', bool $reset=TRUE): string;

    	/**
    	 * Returns the generated 'delete' sql query
    	 *
    	 * @param string $table
    	 * @param bool $reset
    	 * @return string
    	 */
    	public function getCompiledDelete(string $table='', bool $reset=TRUE): string;

    	// --------------------------------------------------------------------------
    	// ! Miscellaneous Methods
    	// --------------------------------------------------------------------------

    	/**
    	 * Clear out the class variables, so the next query can be run
    	 *
    	 * @return void
    	 */
    	public function resetQuery(): void;
    }

    // End of QueryBuilderInterface.php

    diff --git a/apiDocumentation/source/QueryParser.php.html b/apiDocumentation/source/QueryParser.php.html index 9df2888..12af6f8 100644 --- a/apiDocumentation/source/QueryParser.php.html +++ b/apiDocumentation/source/QueryParser.php.html @@ -1,3 +1,3 @@ phpDox - Source of QueryParser.php

    Source of file QueryParser.php

    - Size: 3,003 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/QueryParser.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query;

    use Query\Drivers\DriverInterface;

    /**
     * Utility Class to parse sql clauses for properly escaping identifiers
     */
    class QueryParser {

    	/**
    	 * DB Driver
    	 *
    	 * @var DriverInterface
    	 */
    	private $db;

    	/**
    	 * Regex patterns for various syntax components
    	 *
    	 * @var array
    	 */
    	private $matchPatterns = [
    		'function' => '([a-zA-Z0-9_]+\((.*?)\))',
    		'identifier' => '([a-zA-Z0-9_-]+\.?)+',
    		'operator' => '=|AND|&&?|~|\|\|?|\^|/|>=?|<=?|-|%|OR|\+|NOT|\!=?|<>|XOR'
    	];

    	/**
    	 * Regex matches
    	 *
    	 * @var array
    	 */
    	public $matches = [
    		'functions' => [],
    		'identifiers' => [],
    		'operators' => [],
    		'combined' => [],
    	];

    	/**
    	 * Constructor/entry point into parser
    	 *
    	 * @param DriverInterface $db
    	 */
    	public function __construct(DriverInterface $db)
    	{
    		$this->db = $db;
    	}

    	/**
    	 * Parser method for setting the parse string
    	 *
    	 * @param string $sql
    	 * @return array
    	 */
    	public function parseJoin(string $sql): array
    	{
    		// Get sql clause components
    		preg_match_all('`'.$this->matchPatterns['function'].'`', $sql, $this->matches['functions'], PREG_SET_ORDER);
    		preg_match_all('`'.$this->matchPatterns['identifier'].'`', $sql, $this->matches['identifiers'], PREG_SET_ORDER);
    		preg_match_all('`'.$this->matchPatterns['operator'].'`', $sql, $this->matches['operators'], PREG_SET_ORDER);

    		// Get everything at once for ordering
    		$fullPattern = '`'.$this->matchPatterns['function'].'+|'.$this->matchPatterns['identifier'].'|('.$this->matchPatterns['operator'].')+`i';
    		preg_match_all($fullPattern, $sql, $this->matches['combined'], PREG_SET_ORDER);

    		// Go through the matches, and get the most relevant matches
    		$this->matches = array_map([$this, 'filterArray'], $this->matches);

    		return $this->matches;
    	}

    	/**
    	 * Compiles a join condition after parsing
    	 *
    	 * @param string $condition
    	 * @return string
    	 */
    	public function compileJoin(string $condition): string
    	{
    		$parts = $this->parseJoin($condition);
    		$count = count($parts['identifiers']);

    		// Go through and quote the identifiers
    		for($i=0; $i <= $count; $i++)
    		{
    			if (in_array($parts['combined'][$i], $parts['identifiers']) && ! is_numeric($parts['combined'][$i]))
    			{
    				$parts['combined'][$i] = $this->db->quoteIdent($parts['combined'][$i]);
    			}
    		}

    		return implode('', $parts['combined']);
    	}

    	/**
    	 * Returns a more useful match array
    	 *
    	 * @param array $array
    	 * @return array
    	 */
    	protected function filterArray(array $array): array
    	{
    		$newArray = [];

    		foreach($array as $row)
    		{
    			$newArray[] =  (is_array($row)) ? $row[0] : $row;
    		}

    		return $newArray;
    	}
    }
    + Size: 3,049 Bytes - Last Modified: 2020-04-10T20:54:13-04:00

    src/QueryParser.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    use Query\Drivers\DriverInterface;

    /**
     * Utility Class to parse sql clauses for properly escaping identifiers
     */
    class QueryParser {

    	/**
    	 * DB Driver
    	 *
    	 * @var DriverInterface
    	 */
    	private DriverInterface $db;

    	/**
    	 * Regex patterns for various syntax components
    	 *
    	 * @var array
    	 */
    	private array $matchPatterns = [
    		'function' => '([a-zA-Z0-9_]+\((.*?)\))',
    		'identifier' => '([a-zA-Z0-9_-]+\.?)+',
    		'operator' => '=|AND|&&?|~|\|\|?|\^|/|>=?|<=?|-|%|OR|\+|NOT|\!=?|<>|XOR'
    	];

    	/**
    	 * Regex matches
    	 *
    	 * @var array
    	 */
    	public array $matches = [
    		'functions' => [],
    		'identifiers' => [],
    		'operators' => [],
    		'combined' => [],
    	];

    	/**
    	 * Constructor/entry point into parser
    	 *
    	 * @param DriverInterface $db
    	 */
    	public function __construct(DriverInterface $db)
    	{
    		$this->db = $db;
    	}

    	/**
    	 * Parser method for setting the parse string
    	 *
    	 * @param string $sql
    	 * @return array
    	 */
    	public function parseJoin(string $sql): array
    	{
    		// Get sql clause components
    		preg_match_all('`'.$this->matchPatterns['function'].'`', $sql, $this->matches['functions'], PREG_SET_ORDER);
    		preg_match_all('`'.$this->matchPatterns['identifier'].'`', $sql, $this->matches['identifiers'], PREG_SET_ORDER);
    		preg_match_all('`'.$this->matchPatterns['operator'].'`', $sql, $this->matches['operators'], PREG_SET_ORDER);

    		// Get everything at once for ordering
    		$fullPattern = '`'.$this->matchPatterns['function'].'+|'.$this->matchPatterns['identifier'].'|('.$this->matchPatterns['operator'].')+`i';
    		preg_match_all($fullPattern, $sql, $this->matches['combined'], PREG_SET_ORDER);

    		// Go through the matches, and get the most relevant matches
    		$this->matches = array_map([$this, 'filterArray'], $this->matches);

    		return $this->matches;
    	}

    	/**
    	 * Compiles a join condition after parsing
    	 *
    	 * @param string $condition
    	 * @return string
    	 */
    	public function compileJoin(string $condition): string
    	{
    		$parts = $this->parseJoin($condition);
    		$count = count($parts['identifiers']);

    		// Go through and quote the identifiers
    		for($i=0; $i <= $count; $i++)
    		{
    			if (in_array($parts['combined'][$i], $parts['identifiers']) && ! is_numeric($parts['combined'][$i]))
    			{
    				$parts['combined'][$i] = $this->db->quoteIdent($parts['combined'][$i]);
    			}
    		}

    		return implode('', $parts['combined']);
    	}

    	/**
    	 * Returns a more useful match array
    	 *
    	 * @param array $array
    	 * @return array
    	 */
    	protected function filterArray(array $array): array
    	{
    		$newArray = [];

    		foreach($array as $row)
    		{
    			$newArray[] =  (is_array($row)) ? $row[0] : $row;
    		}

    		return $newArray;
    	}
    }
    diff --git a/apiDocumentation/source/QueryType.php.html b/apiDocumentation/source/QueryType.php.html new file mode 100644 index 0000000..d16e73b --- /dev/null +++ b/apiDocumentation/source/QueryType.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of QueryType.php

    Source of file QueryType.php

    + Size: 0,703 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/QueryType.php

    12345678910111213141516171819202122232425262728
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    /**
     * 'Enum' of query types
     */
    class QueryType {
    	public const SELECT = 'select';
    	public const INSERT = 'insert';
    	public const INSERT_BATCH = 'insert_batch';
    	public const UPDATE = 'update';
    	public const UPDATE_BATCH = 'update_batch';
    	public const DELETE = 'delete';
    }
    diff --git a/apiDocumentation/source/State.php.html b/apiDocumentation/source/State.php.html index fcc54ba..91b22c9 100644 --- a/apiDocumentation/source/State.php.html +++ b/apiDocumentation/source/State.php.html @@ -1,3 +1,3 @@ phpDox - Source of State.php

    Source of file State.php

    - Size: 7,094 Bytes - Last Modified: 2018-02-09T16:14:20-05:00

    src/State.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.1
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2018 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat4ion/Query
     */
    namespace Query;

    /**
     * Query builder state
     */
    class State {
    	// --------------------------------------------------------------------------
    	// ! SQL Clause Strings
    	// --------------------------------------------------------------------------

    	/**
    	 * Compiled 'select' clause
    	 * @var string
    	 */
    	protected $selectString = '';

    	/**
    	 * Compiled 'from' clause
    	 * @var string
    	 */
    	protected $fromString = '';

    	/**
    	 * Compiled arguments for insert / update
    	 * @var string
    	 */
    	protected $setString = '';

    	/**
    	 * Order by clause
    	 * @var string
    	 */
    	protected $orderString = '';

    	/**
    	 * Group by clause
    	 * @var string
    	 */
    	protected $groupString = '';

    	// --------------------------------------------------------------------------
    	// ! SQL Clause Arrays
    	// --------------------------------------------------------------------------

    	/**
    	 * Keys for insert/update statement
    	 * @var array
    	 */
    	protected $setArrayKeys = [];

    	/**
    	 * Key/val pairs for order by clause
    	 * @var array
    	 */
    	protected $orderArray = [];

    	/**
    	 * Key/val pairs for group by clause
    	 * @var array
    	 */
    	protected $groupArray = [];

    	// --------------------------------------------------------------------------
    	// ! Other Class vars
    	// --------------------------------------------------------------------------

    	/**
    	 * Values to apply to prepared statements
    	 * @var array
    	 */
    	protected $values = [];

    	/**
    	 * Values to apply to where clauses in prepared statements
    	 * @var array
    	 */
    	protected $whereValues = [];

    	/**
    	 * Value for limit string
    	 * @var integer
    	 */
    	protected $limit;

    	/**
    	 * Value for offset in limit string
    	 * @var string|false
    	 */
    	protected $offset = FALSE;

    	/**
    	 * Query component order mapping
    	 * for complex select queries
    	 *
    	 * Format:
    	 * [
    	 *		'type' => 'where',
    	 *		'conjunction' => ' AND ',
    	 *		'string' => 'k=?'
    	 * ]
    	 *
    	 * @var array
    	 */
    	protected $queryMap = [];

    	/**
    	 * Map for having clause
    	 * @var array
    	 */
    	protected $havingMap = [];

    	/**
    	 * @param string $str
    	 * @return State
    	 */
    	public function setSelectString(string $str): self
    	{
    		$this->selectString = $str;
    		return $this;
    	}

    	/**
    	 * @return string
    	 */
    	public function getSelectString(): string
    	{
    		return $this->selectString;
    	}

    	/**
    	 * @param string $str
    	 * @return State
    	 */
    	public function appendSelectString(string $str): self
    	{
    		$this->selectString .= $str;
    		return $this;
    	}

    	/**
    	 * @return string
    	 */
    	public function getFromString(): string
    	{
    		return $this->fromString;
    	}

    	/**
    	 * @param string $fromString
    	 * @return State
    	 */
    	public function setFromString(string $fromString): self
    	{
    		$this->fromString = $fromString;
    		return $this;
    	}

    	/**
    	 * @return string
    	 */
    	public function getSetString(): string
    	{
    		return $this->setString;
    	}

    	/**
    	 * @param string $setString
    	 * @return State
    	 */
    	public function setSetString(string $setString): self
    	{
    		$this->setString = $setString;
    		return $this;
    	}

    	/**
    	 * @return string
    	 */
    	public function getOrderString(): string
    	{
    		return $this->orderString;
    	}

    	/**
    	 * @param string $orderString
    	 * @return State
    	 */
    	public function setOrderString(string $orderString): self
    	{
    		$this->orderString = $orderString;
    		return $this;
    	}

    	/**
    	 * @return string
    	 */
    	public function getGroupString(): string
    	{
    		return $this->groupString;
    	}

    	/**
    	 * @param string $groupString
    	 * @return State
    	 */
    	public function setGroupString(string $groupString): self
    	{
    		$this->groupString = $groupString;
    		return $this;
    	}

    	/**
    	 * @return array
    	 */
    	public function getSetArrayKeys(): array
    	{
    		return $this->setArrayKeys;
    	}

    	/**
    	 * @param array $setArrayKeys
    	 * @return State
    	 */
    	public function appendSetArrayKeys(array $setArrayKeys): self
    	{
    		$this->setArrayKeys = array_merge($this->setArrayKeys, $setArrayKeys);
    		return $this;
    	}

    	/**
    	 * @param array $setArrayKeys
    	 * @return State
    	 */
    	public function setSetArrayKeys(array $setArrayKeys): self
    	{
    		$this->setArrayKeys = $setArrayKeys;
    		return $this;
    	}

    	/**
    	 * @return array
    	 */
    	public function getOrderArray(): array
    	{
    		return $this->orderArray;
    	}

    	/**
    	 * @param string $key
    	 * @param mixed $orderArray
    	 * @return State
    	 */
    	public function setOrderArray(string $key, $orderArray): self
    	{
    		$this->orderArray[$key] = $orderArray;
    		return $this;
    	}

    	/**
    	 * @return array
    	 */
    	public function getGroupArray(): array
    	{
    		return $this->groupArray;
    	}

    	/**
    	 * @param array $groupArray
    	 * @return State
    	 */
    	public function setGroupArray(array $groupArray): self
    	{
    		$this->groupArray = $groupArray;
    		return $this;
    	}

    	/**
    	 * @param string $groupArray
    	 * @return State
    	 */
    	public function appendGroupArray(string $groupArray): self
    	{
    		$this->groupArray[] = $groupArray;
    		return $this;
    	}

    	/**
    	 * @return array
    	 */
    	public function getValues(): array
    	{
    		return $this->values;
    	}

    	/**
    	 * @param array $values
    	 * @return State
    	 */
    	public function appendValues(array $values): self
    	{
    		$this->values = array_merge($this->values, $values);
    		return $this;
    	}

    	/**
    	 * @return array
    	 */
    	public function getWhereValues(): array
    	{
    		return $this->whereValues;
    	}

    	/**
    	 * @param mixed $val
    	 * @return State
    	 */
    	public function appendWhereValues($val): self
    	{
    		if (\is_array($val))
    		{
    			foreach($val as $v)
    			{
    				$this->whereValues[] = $v;
    			}

    			return $this;
    		}

    		$this->whereValues[] = $val;
    		return $this;
    	}

    	/**
    	 * @return int
    	 */
    	public function getLimit(): ?int
    	{
    		return $this->limit;
    	}

    	/**
    	 * @param int $limit
    	 * @return State
    	 */
    	public function setLimit(int $limit): self
    	{
    		$this->limit = $limit;
    		return $this;
    	}

    	/**
    	 * @return string|false
    	 */
    	public function getOffset()
    	{
    		return $this->offset;
    	}

    	/**
    	 * @param string|false $offset
    	 * @return State
    	 */
    	public function setOffset($offset): self
    	{
    		$this->offset = $offset;
    		return $this;
    	}

    	/**
    	 * @return array
    	 */
    	public function getQueryMap(): array
    	{
    		return $this->queryMap;
    	}

    	/**
    	 * Add an additional set of mapping pairs to a internal map
    	 *
    	 * @param string $conjunction
    	 * @param string $string
    	 * @param string $type
    	 * @return State
    	 */
    	public function appendMap(string $conjunction = '', string $string = '', string $type = ''): self
    	{
    		$this->queryMap[] = [
    			'type' => $type,
    			'conjunction' => $conjunction,
    			'string' => $string
    		];
    		return $this;
    	}

    	/**
    	 * @return array
    	 */
    	public function getHavingMap(): array
    	{
    		return $this->havingMap;
    	}

    	/**
    	 * @param array $item
    	 * @return State
    	 */
    	public function appendHavingMap(array $item): self
    	{
    		$this->havingMap[] = $item;
    		return $this;
    	}
    }

    + Size: 5,625 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/State.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace Query;

    use function is_array;

    /**
     * Query builder state
     *
     * @method getSelectString(): string
     * @method getFromString(): string
     * @method getSetString(): string
     * @method getOrderString(): string
     * @method getGroupString(): string
     * @method getSetArrayKeys(): array
     * @method getOrderArray(): array
     * @method getGroupArray(): array
     * @method getValues(): array
     * @method getWhereValues(): array
     * @method getLimit(): int|null
     * @method getOffset()
     * @method getQueryMap(): array
     * @method getHavingMap(): array
     *
     * @method setSelectString(string $selectString): self
     * @method setFromString(string $fromString): self
     * @method setSetString(string $setString): self
     * @method setOrderString(string $orderString): self
     * @method setGroupString(string $groupString): self
     * @method setSetArrayKeys(array $arrayKeys): self
     * @method setGroupArray(array $array): self
     * @method setLimit(int $limit): self
     * @method setOffset(?int $offset): self
     */
    class State {
    	// --------------------------------------------------------------------------
    	// ! SQL Clause Strings
    	// --------------------------------------------------------------------------

    	/**
    	 * Compiled 'select' clause
    	 * @var string
    	 */
    	protected string $selectString = '';

    	/**
    	 * Compiled 'from' clause
    	 * @var string
    	 */
    	protected string $fromString = '';

    	/**
    	 * Compiled arguments for insert / update
    	 * @var string
    	 */
    	protected string $setString = '';

    	/**
    	 * Order by clause
    	 * @var string
    	 */
    	protected string $orderString = '';

    	/**
    	 * Group by clause
    	 * @var string
    	 */
    	protected string $groupString = '';

    	// --------------------------------------------------------------------------
    	// ! SQL Clause Arrays
    	// --------------------------------------------------------------------------

    	/**
    	 * Keys for insert/update statement
    	 * @var array
    	 */
    	protected array $setArrayKeys = [];

    	/**
    	 * Key/val pairs for order by clause
    	 * @var array
    	 */
    	protected array $orderArray = [];

    	/**
    	 * Key/val pairs for group by clause
    	 * @var array
    	 */
    	protected array $groupArray = [];

    	// --------------------------------------------------------------------------
    	// ! Other Class vars
    	// --------------------------------------------------------------------------

    	/**
    	 * Values to apply to prepared statements
    	 * @var array
    	 */
    	protected array $values = [];

    	/**
    	 * Values to apply to where clauses in prepared statements
    	 * @var array
    	 */
    	protected array $whereValues = [];

    	/**
    	 * Value for limit string
    	 * @var int
    	 */
    	protected ?int $limit = NULL;

    	/**
    	 * Value for offset in limit string
    	 * @var int
    	 */
    	protected ?int $offset = NULL;

    	/**
    	 * Query component order mapping
    	 * for complex select queries
    	 *
    	 * Format:
    	 * [
    	 *		'type' => 'where',
    	 *		'conjunction' => ' AND ',
    	 *		'string' => 'k=?'
    	 * ]
    	 *
    	 * @var array
    	 */
    	protected array $queryMap = [];

    	/**
    	 * Map for having clause
    	 * @var array
    	 */
    	protected array $havingMap = [];

    	public function __call(string $name, array $arguments)
    	{
    		if (strpos($name, 'get', 0) === 0)
    		{
    			$maybeProp = lcfirst(substr($name, 3));
    			if (isset($this->$maybeProp))
    			{
    				return $this->$maybeProp;
    			}
    		}

    		if (strpos($name, 'set', 0) === 0)
    		{
    			$maybeProp = lcfirst(substr($name, 3));
    			if (isset($this->$maybeProp))
    			{
    				$this->$maybeProp = $arguments[0];
    				return $this;
    			}
    		}

    		return NULL;
    	}

    	/**
    	 * @param string $str
    	 * @return State
    	 */
    	public function appendSelectString(string $str): self
    	{
    		$this->selectString .= $str;
    		return $this;
    	}

    	/**
    	 * @param array $setArrayKeys
    	 * @return State
    	 */
    	public function appendSetArrayKeys(array $setArrayKeys): self
    	{
    		$this->setArrayKeys = array_merge($this->setArrayKeys, $setArrayKeys);
    		return $this;
    	}

    	/**
    	 * @param string $key
    	 * @param mixed $orderArray
    	 * @return State
    	 */
    	public function setOrderArray(string $key, $orderArray): self
    	{
    		$this->orderArray[$key] = $orderArray;
    		return $this;
    	}

    	/**
    	 * @param string $groupArray
    	 * @return State
    	 */
    	public function appendGroupArray(string $groupArray): self
    	{
    		$this->groupArray[] = $groupArray;
    		return $this;
    	}

    	/**
    	 * @param array $values
    	 * @return State
    	 */
    	public function appendValues(array $values): self
    	{
    		$this->values = array_merge($this->values, $values);
    		return $this;
    	}

    	/**
    	 * @param mixed $val
    	 * @return State
    	 */
    	public function appendWhereValues($val): self
    	{
    		if (is_array($val))
    		{
    			foreach($val as $v)
    			{
    				$this->whereValues[] = $v;
    			}

    			return $this;
    		}

    		$this->whereValues[] = $val;
    		return $this;
    	}

    	/**
    	 * Add an additional set of mapping pairs to a internal map
    	 *
    	 * @param string $conjunction
    	 * @param string $string
    	 * @param string $type
    	 * @return State
    	 */
    	public function appendMap(string $conjunction = '', string $string = '', string $type = ''): self
    	{
    		$this->queryMap[] = [
    			'type' => $type,
    			'conjunction' => $conjunction,
    			'string' => $string
    		];
    		return $this;
    	}

    	/**
    	 * @param array $item
    	 * @return State
    	 */
    	public function appendHavingMap(array $item): self
    	{
    		$this->havingMap[] = $item;
    		return $this;
    	}
    }

    diff --git a/apiDocumentation/source/common.php.html b/apiDocumentation/source/common.php.html index a104064..21396b8 100644 --- a/apiDocumentation/source/common.php.html +++ b/apiDocumentation/source/common.php.html @@ -1,3 +1,3 @@ phpDox - Source of common.php

    Source of file common.php

    - Size: 2,752 Bytes - Last Modified: 2019-12-11T16:04:08-05:00

    src/common.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7
     *
     * @package	 Query
     * @author	  Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2016 Timothy J. Warren
     * @license	 http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link		https://git.timshomepage.net/aviat4ion/Query
     */

    namespace {

    	use Query\{
    		ConnectionManager,
    		QueryBuilderInterface
    	};

    	/**
    	 * Global functions that don't really fit anywhere else
    	 */

    	/**
    	 * Multibyte-safe trim function
    	 *
    	 * @param string $string
    	 * @return string
    	 */
    	function mb_trim(string $string): string
    	{
    		return preg_replace('/(^\s+)|(\s+$)/u', '', $string);
    	}

    	/**
    	 * Filter out db rows into one array
    	 *
    	 * @param array $array
    	 * @param mixed $index
    	 * @return array
    	 */
    	function dbFilter(array $array, $index): array
    	{
    		$newArray = [];

    		foreach ($array as $a)
    		{
    			$newArray[] = $a[$index];
    		}

    		return $newArray;
    	}

    	/**
    	 * Zip a set of arrays together on common keys
    	 *
    	 * The $zipperInput array is an array of arrays indexed by their place in the output
    	 * array.
    	 *
    	 * @param array $zipperInput
    	 * @return array
    	 */
    	function arrayZipper(array $zipperInput): array
    	{
    		$output = [];

    		foreach ($zipperInput as $appendKey => $values)
    		{
    			foreach ($values as $index => $value)
    			{
    				if ( ! isset($output[$index]))
    				{
    					$output[$index] = [];
    				}
    				$output[$index][$appendKey] = $value;
    			}
    		}

    		return $output;
    	}

    	/**
    	 * Determine whether a value in the passed array matches the pattern
    	 * passed
    	 *
    	 * @param array $array
    	 * @param string $pattern
    	 * @return bool
    	 */
    	function regexInArray(array $array, string $pattern): bool
    	{
    		if (empty($array))
    		{
    			return FALSE;
    		}

    		foreach ($array as $item)
    		{
    			if (is_scalar($item) && preg_match($pattern, $item))
    			{
    				return TRUE;
    			}
    		}

    		return FALSE;
    	}

    	/**
    	 * Connection function
    	 *
    	 * Send an array or object as connection parameters to create a connection. If
    	 * the array or object has an 'alias' parameter, passing that string to this
    	 * function will return that connection. Passing no parameters returns the last
    	 * connection created.
    	 *
    	 * @param string|object|array $params
    	 * @return QueryBuilderInterface|null
    	 */
    	function Query($params = ''): ?QueryBuilderInterface
    	{
    		if ($params === NULL)
    		{
    			return NULL;
    		}

    		$manager = ConnectionManager::getInstance();

    		// If you are getting a previously created connection
    		if (is_scalar($params))
    		{
    			return $manager->getConnection($params);
    		}

    		$paramsObject = (object)$params;

    		// Otherwise, return a new connection
    		return $manager->connect($paramsObject);
    	}

    }
    // End of common.php

    + Size: 2,787 Bytes - Last Modified: 2020-04-17T14:56:27-04:00

    src/common.php

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
    <?php declare(strict_types=1);
    /**
     * Query
     *
     * SQL Query Builder / Database Abstraction Layer
     *
     * PHP version 7.4
     *
     * @package     Query
     * @author      Timothy J. Warren <tim@timshomepage.net>
     * @copyright   2012 - 2020 Timothy J. Warren
     * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
     * @link        https://git.timshomepage.net/aviat/Query
     * @version     3.0.0
     */
    namespace {

    	use Query\ConnectionManager;
    	use Query\QueryBuilderInterface;

    	/**
    	 * Global functions that don't really fit anywhere else
    	 */

    	/**
    	 * Multibyte-safe trim function
    	 *
    	 * @param string $string
    	 * @return string
    	 */
    	function mb_trim(string $string): string
    	{
    		return preg_replace('/(^\s+)|(\s+$)/u', '', $string);
    	}

    	/**
    	 * Filter out db rows into one array
    	 *
    	 * @param array $array
    	 * @param mixed $index
    	 * @return array
    	 */
    	function dbFilter(array $array, $index): array
    	{
    		$newArray = [];

    		foreach ($array as $a)
    		{
    			$newArray[] = $a[$index];
    		}

    		return $newArray;
    	}

    	/**
    	 * Zip a set of arrays together on common keys
    	 *
    	 * The $zipperInput array is an array of arrays indexed by their place in the output
    	 * array.
    	 *
    	 * @param array $zipperInput
    	 * @return array
    	 */
    	function arrayZipper(array $zipperInput): array
    	{
    		$output = [];

    		foreach ($zipperInput as $appendKey => $values)
    		{
    			foreach ($values as $index => $value)
    			{
    				if ( ! isset($output[$index]))
    				{
    					$output[$index] = [];
    				}
    				$output[$index][$appendKey] = $value;
    			}
    		}

    		return $output;
    	}

    	/**
    	 * Determine whether a value in the passed array matches the pattern
    	 * passed
    	 *
    	 * @param array $array
    	 * @param string $pattern
    	 * @return bool
    	 */
    	function regexInArray(array $array, string $pattern): bool
    	{
    		if (empty($array))
    		{
    			return FALSE;
    		}

    		foreach ($array as $item)
    		{
    			if (is_scalar($item) && preg_match($pattern, $item))
    			{
    				return TRUE;
    			}
    		}

    		return FALSE;
    	}

    	/**
    	 * Connection function
    	 *
    	 * Send an array or object as connection parameters to create a connection. If
    	 * the array or object has an 'alias' parameter, passing that string to this
    	 * function will return that connection. Passing no parameters returns the last
    	 * connection created.
    	 *
    	 * @param string|object|array $params
    	 * @return QueryBuilderInterface|null
    	 */
    	function Query($params = ''): ?QueryBuilderInterface
    	{
    		if ($params === NULL)
    		{
    			return NULL;
    		}

    		$manager = ConnectionManager::getInstance();

    		// If you are getting a previously created connection
    		if (is_scalar($params))
    		{
    			return $manager->getConnection($params);
    		}

    		$paramsObject = (object)$params;

    		// Otherwise, return a new connection
    		return $manager->connect($paramsObject);
    	}
    }
    // End of common.php

    diff --git a/apiDocumentation/traits.html b/apiDocumentation/traits.html index 2a3acb3..5acd338 100644 --- a/apiDocumentation/traits.html +++ b/apiDocumentation/traits.html @@ -32,7 +32,7 @@

    Traits