-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
127 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,22 +43,26 @@ $conn = \ByJG\AnyDataset\Db\Factory::getDbInstance("mysql://root:[email protected] | |
|
||
- [Getting Started](docs/getting-started.md) | ||
- [Basic Query and Update](docs/basic-query.md) | ||
- [Sql Statement Object](docs/sqlstatement.md) | ||
- [Cache results](docs/cache.md) | ||
- [Database Transaction](docs/transaction.md) | ||
- [Load Balance and Connection Pooling](docs/load-balance.md) | ||
- [Database Helper](docs/helper.md) | ||
- [Filtering the Query](docs/iteratorfilter.md) | ||
|
||
## Advanced Topics | ||
|
||
- [Passing Parameters to PDODriver](docs/parameters.md) | ||
- [Generic PDO Driver](docs/generic-pdo-driver.md) | ||
- [Running Tests](docs/tests.md) | ||
- [Getting an Iterator from an existing PDO Statament](docs/pdostatement.md) | ||
|
||
## Database Specifics | ||
|
||
- [MySQL](docs/mysql.md) | ||
- [Oracle](docs/oracle.md) | ||
- [SQLServer](docs/sqlserver.md) | ||
- [Literal PDO Connection String](docs/literal-pdo-driver.md) | ||
|
||
|
||
## Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Basics | ||
|
||
## Basic Query | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Getting Started | ||
|
||
## 1. Install the ByJG AnyDatasetDB library | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
sidebar_position: 12 | ||
--- | ||
|
||
# Using a PDO Statement | ||
|
||
If you have a PDO Statement created outside the AnyDatasetDB library, | ||
you can use it to create an iterator. | ||
|
||
```php | ||
<?php | ||
$pdo = new PDO('sqlite::memory:'); | ||
$stmt = $pdo->prepare('select * from info where id = :id'); | ||
$stmt->execute(['id' => 1]); | ||
|
||
$iterator = $this->dbDriver->getIterator($stmt); | ||
$this->assertEquals( | ||
[ | ||
[ 'id'=> 1, 'iduser' => 1, 'number' => 10.45, 'property' => 'xxx'], | ||
], | ||
$iterator->toArray() | ||
); | ||
``` | ||
|
||
Note: | ||
|
||
* Although you can use a PDO Statement, it is recommended to use the | ||
`SqlStatement` or `DbDriverInterface` to get the Query. | ||
* Use this feature with legacy code or when you have a specific need to use a PDO Statement. | ||
|
||
## Benefits | ||
|
||
You can integrate the AnyDatasetDB library with your legacy code and get the benefits of the library | ||
as for example the standard `GenericIterator` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
sidebar_position: 11 | ||
--- | ||
|
||
# Running Unit tests | ||
|
||
## Unit Tests (no DBConnection) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
sidebar_position: 5 | ||
--- | ||
|
||
# Database Transaction | ||
|
||
## Basics | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters