Changed Data namespace to Db.
In case you wanted more breaking changes.
This commit is contained in:
parent
28d65263be
commit
9ed97e8575
44 changed files with 114 additions and 114 deletions
|
@ -20,13 +20,13 @@ The way each implementation stores data is NOT guaranteed to be compatible, plea
|
||||||
Requires the `redis` extension.
|
Requires the `redis` extension.
|
||||||
Valkey is the name of the Linux Foundation's fork of Redis.
|
Valkey is the name of the Linux Foundation's fork of Redis.
|
||||||
|
|
||||||
### `Index\Data\MariaDb`
|
### `Index\Db\MariaDb`
|
||||||
|
|
||||||
Requires the `mysqli` extension.
|
Requires the `mysqli` extension.
|
||||||
`mysqlnd` is recommended as the underlying driver, but `libmysql` should work without a hitch.
|
`mysqlnd` is recommended as the underlying driver, but `libmysql` should work without a hitch.
|
||||||
This driver also works for MySQL as the dependencies would suggest, but you should consider using MariaDB instead of possible.
|
This driver also works for MySQL as the dependencies would suggest, but you should consider using MariaDB instead of possible.
|
||||||
|
|
||||||
### `Index\Data\Sqlite`
|
### `Index\Db\Sqlite`
|
||||||
|
|
||||||
Requires the `sqlite3` extension.
|
Requires the `sqlite3` extension.
|
||||||
|
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
0.2410.42227
|
0.2410.42235
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
"phpstan/phpstan": "^1.11"
|
"phpstan/phpstan": "^1.11"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-mysqli": "Support for the Index\\Data\\MariaDb namespace (both mysqlnd and libmysql are supported).",
|
"ext-mysqli": "Support for the Index\\Db\\MariaDb namespace (both mysqlnd and libmysql are supported).",
|
||||||
"ext-sqlite3": "Support for the Index\\Data\\Sqlite namespace."
|
"ext-sqlite3": "Support for the Index\\Db\\Sqlite namespace."
|
||||||
},
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Index\Config\Db;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Index\Config\{Config,GetValueInfoTrait,GetValuesTrait,MutableConfigTrait,ScopedConfig};
|
use Index\Config\{Config,GetValueInfoTrait,GetValuesTrait,MutableConfigTrait,ScopedConfig};
|
||||||
use Index\Data\{DbConnection,DbStatementCache,DbTools};
|
use Index\Db\{DbConnection,DbStatementCache,DbTools};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a configuration based on a {@see DbConnection} instance.
|
* Provides a configuration based on a {@see DbConnection} instance.
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Index\Config\Db;
|
||||||
|
|
||||||
use UnexpectedValueException;
|
use UnexpectedValueException;
|
||||||
use Index\Config\ConfigValueInfo;
|
use Index\Config\ConfigValueInfo;
|
||||||
use Index\Data\DbResult;
|
use Index\Db\DbResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides information about a databased configuration value.
|
* Provides information about a databased configuration value.
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbBackend.php
|
// DbBackend.php
|
||||||
// Created: 2021-04-30
|
// Created: 2021-04-30
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information about a database layer. Should not have any external dependencies.
|
* Information about a database layer. Should not have any external dependencies.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbConnection.php
|
// DbConnection.php
|
||||||
// Created: 2021-04-30
|
// Created: 2021-04-30
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
use Index\Closeable;
|
use Index\Closeable;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbConnectionInfo.php
|
// DbConnectionInfo.php
|
||||||
// Created: 2021-04-30
|
// Created: 2021-04-30
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base type for database connection info.
|
* Base type for database connection info.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbResult.php
|
// DbResult.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
use Index\Closeable;
|
use Index\Closeable;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbResultIterator.php
|
// DbResultIterator.php
|
||||||
// Created: 2024-02-06
|
// Created: 2024-02-06
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Iterator;
|
use Iterator;
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbResultTrait.php
|
// DbResultTrait.php
|
||||||
// Created: 2023-11-09
|
// Created: 2023-11-09
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements common DbResult methods.
|
* Implements common DbResult methods.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbStatement.php
|
// DbStatement.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbStatementCache.php
|
// DbStatementCache.php
|
||||||
// Created: 2023-07-21
|
// Created: 2023-07-21
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container to avoid having many prepared instances of the same query.
|
* Container to avoid having many prepared instances of the same query.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbTools.php
|
// DbTools.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
use Countable;
|
use Countable;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
@ -18,9 +18,9 @@ use RuntimeException;
|
||||||
* the rest of the URL is described in the documentation of the parseDsn implementation of the respective backend.
|
* the rest of the URL is described in the documentation of the parseDsn implementation of the respective backend.
|
||||||
*
|
*
|
||||||
* The scheme can be a PHP classpath to an implementation of DbBackend, or any of these aliases:
|
* The scheme can be a PHP classpath to an implementation of DbBackend, or any of these aliases:
|
||||||
* - `null`: maps to `NullDb\NullDbBackend` or `Index-Data-NullDb-NullDbBackend`, provides a fallback blackhole database backend.
|
* - `null`: maps to `NullDb\NullDbBackend` or `Index-Db-NullDb-NullDbBackend`, provides a fallback blackhole database backend.
|
||||||
* - `mariadb`, `mysql`: maps to `MariaDb\MariaDbBackend` or `Index-Data-MariaDb-MariaDbBackend`, provides a backend based on the mysqli extension.
|
* - `mariadb`, `mysql`: maps to `MariaDb\MariaDbBackend` or `Index-Db-MariaDb-MariaDbBackend`, provides a backend based on the mysqli extension.
|
||||||
* - `sqlite`, `sqlite3`: maps to `Sqlite\SqliteBackend` or `Index-Data-Sqlite-SqliteBackend`, provides a backend based on the sqlite3 extension.
|
* - `sqlite`, `sqlite3`: maps to `Sqlite\SqliteBackend` or `Index-Db-Sqlite-SqliteBackend`, provides a backend based on the sqlite3 extension.
|
||||||
*
|
*
|
||||||
* Short names are currently hardcoded and cannot be expanded.
|
* Short names are currently hardcoded and cannot be expanded.
|
||||||
*/
|
*/
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbTransactions.php
|
// DbTransactions.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates supports for transactions in a database connection.
|
* Indicates supports for transactions in a database connection.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbType.php
|
// DbType.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2021-05-04
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data;
|
namespace Index\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of common database types.
|
* Map of common database types.
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbBackend.php
|
// MariaDbBackend.php
|
||||||
// Created: 2021-04-30
|
// Created: 2021-04-30
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Index\Data\{DbBackend,DbConnection,DbConnectionInfo};
|
use Index\Db\{DbBackend,DbConnection,DbConnectionInfo};
|
||||||
use Index\Net\{EndPoint,UnixEndPoint};
|
use Index\Net\{EndPoint,UnixEndPoint};
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbCharacterSetInfo.php
|
// MariaDbCharacterSetInfo.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains information about the character set.
|
* Contains information about the character set.
|
|
@ -1,16 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbConnection.php
|
// MariaDbConnection.php
|
||||||
// Created: 2021-04-30
|
// Created: 2021-04-30
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use mysqli;
|
use mysqli;
|
||||||
use mysqli_sql_exception;
|
use mysqli_sql_exception;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\Data\{DbConnection,DbTransactions};
|
use Index\Db\{DbConnection,DbTransactions};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a connection with a MariaDB or MySQL database server.
|
* Represents a connection with a MariaDB or MySQL database server.
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbConnectionInfo.php
|
// MariaDbConnectionInfo.php
|
||||||
// Created: 2021-04-30
|
// Created: 2021-04-30
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Index\Data\DbConnectionInfo;
|
use Index\Db\DbConnectionInfo;
|
||||||
use Index\Net\{EndPoint,DnsEndPoint,IpEndPoint,UnixEndPoint};
|
use Index\Net\{EndPoint,DnsEndPoint,IpEndPoint,UnixEndPoint};
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbParameter.php
|
// MariaDbParameter.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use Index\Data\{DbTools,DbType};
|
use Index\Db\{DbTools,DbType};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a bound parameter.
|
* Represents a bound parameter.
|
|
@ -1,14 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbResult.php
|
// MariaDbResult.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use mysqli_result;
|
use mysqli_result;
|
||||||
use mysqli_stmt;
|
use mysqli_stmt;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Index\Data\{DbResult,DbResultTrait};
|
use Index\Db\{DbResult,DbResultTrait};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a MariaDB/MySQL database result.
|
* Represents a MariaDB/MySQL database result.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbResultLib.php
|
// MariaDbResultLib.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use mysqli_stmt;
|
use mysqli_stmt;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbResultNative.php
|
// MariaDbResultNative.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use mysqli_result;
|
use mysqli_result;
|
||||||
use mysqli_stmt;
|
use mysqli_stmt;
|
|
@ -1,15 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbStatement.php
|
// MariaDbStatement.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use mysqli_stmt;
|
use mysqli_stmt;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Stringable;
|
use Stringable;
|
||||||
use Index\Data\{DbType,DbStatement};
|
use Index\Db\{DbType,DbStatement};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a MariaDB/MySQL prepared statement.
|
* Represents a MariaDB/MySQL prepared statement.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbWarning.php
|
// MariaDbWarning.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
use mysqli_warning;
|
use mysqli_warning;
|
||||||
use Stringable;
|
use Stringable;
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// DbMigration.php
|
// DbMigration.php
|
||||||
// Created: 2023-01-07
|
// Created: 2023-01-07
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Migration;
|
namespace Index\Db\Migration;
|
||||||
|
|
||||||
use Index\Data\DbConnection;
|
use Index\Db\DbConnection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for migration classes to inherit.
|
* Interface for migration classes to inherit.
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// DbMigrationInfo.php
|
// DbMigrationInfo.php
|
||||||
// Created: 2023-01-07
|
// Created: 2023-01-07
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Migration;
|
namespace Index\Db\Migration;
|
||||||
|
|
||||||
use Index\Data\DbConnection;
|
use Index\Db\DbConnection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information on a migration repository item.
|
* Information on a migration repository item.
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbMigrationManager.php
|
// DbMigrationManager.php
|
||||||
// Created: 2023-01-07
|
// Created: 2023-01-07
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Migration;
|
namespace Index\Db\Migration;
|
||||||
|
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
|
@ -11,8 +11,8 @@ use DateTimeInterface;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\XDateTime;
|
use Index\XDateTime;
|
||||||
use Index\Data\{DbConnection,DbStatement,DbType};
|
use Index\Db\{DbConnection,DbStatement,DbType};
|
||||||
use Index\Data\Sqlite\SqliteConnection;
|
use Index\Db\Sqlite\SqliteConnection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a common interface for database migrations.
|
* Provides a common interface for database migrations.
|
||||||
|
@ -34,8 +34,8 @@ class DbMigrationManager {
|
||||||
|
|
||||||
private const TEMPLATE = <<<EOF
|
private const TEMPLATE = <<<EOF
|
||||||
<?php
|
<?php
|
||||||
use Index\Data\DbConnection;
|
use Index\Db\DbConnection;
|
||||||
use Index\Data\Migration\DbMigration;
|
use Index\Db\Migration\DbMigration;
|
||||||
|
|
||||||
final class %s implements DbMigration {
|
final class %s implements DbMigration {
|
||||||
public function migrate(DbConnection \$conn): void {
|
public function migrate(DbConnection \$conn): void {
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// DbMigrationRepo.php
|
// DbMigrationRepo.php
|
||||||
// Created: 2023-01-07
|
// Created: 2023-01-07
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Migration;
|
namespace Index\Db\Migration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a repository of migrations.
|
* Represents a repository of migrations.
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// FsDbMigrationInfo.php
|
// FsDbMigrationInfo.php
|
||||||
// Created: 2023-01-07
|
// Created: 2023-01-07
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Migration;
|
namespace Index\Db\Migration;
|
||||||
|
|
||||||
use Index\Data\DbConnection;
|
use Index\Db\DbConnection;
|
||||||
|
|
||||||
class FsDbMigrationInfo implements DbMigrationInfo {
|
class FsDbMigrationInfo implements DbMigrationInfo {
|
||||||
private string $name;
|
private string $name;
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// FsDbMigrationRepo.php
|
// FsDbMigrationRepo.php
|
||||||
// Created: 2023-01-07
|
// Created: 2023-01-07
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Migration;
|
namespace Index\Db\Migration;
|
||||||
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// NullDbBackend.php
|
// NullDbBackend.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\NullDb;
|
namespace Index\Db\NullDb;
|
||||||
|
|
||||||
use Index\Data\{DbBackend,DbConnection,DbConnectionInfo};
|
use Index\Db\{DbBackend,DbConnection,DbConnectionInfo};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information about the dummy database layer.
|
* Information about the dummy database layer.
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// NullDbConnection.php
|
// NullDbConnection.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\NullDb;
|
namespace Index\Db\NullDb;
|
||||||
|
|
||||||
use Index\Data\{DbConnection,DbStatement,DbResult};
|
use Index\Db\{DbConnection,DbStatement,DbResult};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a dummy database connection.
|
* Represents a dummy database connection.
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// NullDbConnectionInfo.php
|
// NullDbConnectionInfo.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\NullDb;
|
namespace Index\Db\NullDb;
|
||||||
|
|
||||||
use Index\Data\DbConnectionInfo;
|
use Index\Db\DbConnectionInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents dummy connection info.
|
* Represents dummy connection info.
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// NullDbResult.php
|
// NullDbResult.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\NullDb;
|
namespace Index\Db\NullDb;
|
||||||
|
|
||||||
use Index\Data\{DbResult,DbResultIterator};
|
use Index\Db\{DbResult,DbResultIterator};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a dummy database result.
|
* Represents a dummy database result.
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// NullDbStatement.php
|
// NullDbStatement.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\NullDb;
|
namespace Index\Db\NullDb;
|
||||||
|
|
||||||
use Index\Data\{DbType,DbResult,DbStatement};
|
use Index\Db\{DbType,DbResult,DbStatement};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a dummy database statement.
|
* Represents a dummy database statement.
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
// SqliteBackend.php
|
// SqliteBackend.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Sqlite;
|
namespace Index\Db\Sqlite;
|
||||||
|
|
||||||
use SQLite3;
|
use SQLite3;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Index\Data\{DbBackend,DbConnection,DbConnectionInfo};
|
use Index\Db\{DbBackend,DbConnection,DbConnectionInfo};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information about the SQLite 3 database layer.
|
* Information about the SQLite 3 database layer.
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
// SqliteConnection.php
|
// SqliteConnection.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Sqlite;
|
namespace Index\Db\Sqlite;
|
||||||
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use SQLite3;
|
use SQLite3;
|
||||||
use Index\Data\{DbConnection,DbTransactions,DbStatement,DbResult};
|
use Index\Db\{DbConnection,DbTransactions,DbStatement,DbResult};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a client for an SQLite database.
|
* Represents a client for an SQLite database.
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// SqliteConnectionInfo.php
|
// SqliteConnectionInfo.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Sqlite;
|
namespace Index\Db\Sqlite;
|
||||||
|
|
||||||
use Index\Data\DbConnectionInfo;
|
use Index\Db\DbConnectionInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents information about a SQLite Client.
|
* Represents information about a SQLite Client.
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
// SqliteResult.php
|
// SqliteResult.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Sqlite;
|
namespace Index\Db\Sqlite;
|
||||||
|
|
||||||
use SQLite3Result;
|
use SQLite3Result;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Index\Data\{DbResult,DbResultTrait};
|
use Index\Db\{DbResult,DbResultTrait};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an SQLite result set.
|
* Represents an SQLite result set.
|
|
@ -1,15 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
// SqliteStatement.php
|
// SqliteStatement.php
|
||||||
// Created: 2021-05-02
|
// Created: 2021-05-02
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
namespace Index\Data\Sqlite;
|
namespace Index\Db\Sqlite;
|
||||||
|
|
||||||
use SQLite3Result;
|
use SQLite3Result;
|
||||||
use SQLite3Stmt;
|
use SQLite3Stmt;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\Data\{DbTools,DbType,DbStatement,DbResult};
|
use Index\Db\{DbTools,DbType,DbStatement,DbResult};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a prepared SQLite SQL statement.
|
* Represents a prepared SQLite SQL statement.
|
|
@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase;
|
||||||
use PHPUnit\Framework\Attributes\CoversClass;
|
use PHPUnit\Framework\Attributes\CoversClass;
|
||||||
use Index\Config\{GetValueInfoTrait,GetValuesTrait,MutableConfigTrait};
|
use Index\Config\{GetValueInfoTrait,GetValuesTrait,MutableConfigTrait};
|
||||||
use Index\Config\Db\{DbConfig,DbConfigValueInfo};
|
use Index\Config\Db\{DbConfig,DbConfigValueInfo};
|
||||||
use Index\Data\{DbConnection,DbTools};
|
use Index\Db\{DbConnection,DbTools};
|
||||||
|
|
||||||
#[CoversClass(DbConfig::class)]
|
#[CoversClass(DbConfig::class)]
|
||||||
#[CoversClass(DbConfigValueInfo::class)]
|
#[CoversClass(DbConfigValueInfo::class)]
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
// DbToolsTest.php
|
// DbToolsTest.php
|
||||||
// Created: 2021-04-28
|
// Created: 2021-04-28
|
||||||
// Updated: 2024-10-02
|
// Updated: 2024-10-04
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use PHPUnit\Framework\Attributes\{CoversClass,UsesClass};
|
use PHPUnit\Framework\Attributes\{CoversClass,UsesClass};
|
||||||
use Index\Data\{DbTools,DbType};
|
use Index\Db\{DbTools,DbType};
|
||||||
use Index\Data\MariaDb\MariaDbBackend;
|
use Index\Db\MariaDb\MariaDbBackend;
|
||||||
use Index\Data\NullDb\NullDbConnection;
|
use Index\Db\NullDb\NullDbConnection;
|
||||||
use Index\Data\Sqlite\SqliteBackend;
|
use Index\Db\Sqlite\SqliteBackend;
|
||||||
|
|
||||||
#[CoversClass(DbTools::class)]
|
#[CoversClass(DbTools::class)]
|
||||||
#[CoversClass(DbType::class)]
|
#[CoversClass(DbType::class)]
|
||||||
|
@ -38,7 +38,7 @@ final class DbToolsTest extends TestCase {
|
||||||
$nullDbConn1 = DbTools::create('null:');
|
$nullDbConn1 = DbTools::create('null:');
|
||||||
$this->assertInstanceOf(NullDbConnection::class, $nullDbConn1);
|
$this->assertInstanceOf(NullDbConnection::class, $nullDbConn1);
|
||||||
|
|
||||||
$nullDbConn2 = DbTools::create('Index-Data-NullDb-NullDbBackend:');
|
$nullDbConn2 = DbTools::create('Index-Db-NullDb-NullDbBackend:');
|
||||||
$this->assertInstanceOf(NullDbConnection::class, $nullDbConn2);
|
$this->assertInstanceOf(NullDbConnection::class, $nullDbConn2);
|
||||||
|
|
||||||
$maria = new MariaDbBackend;
|
$maria = new MariaDbBackend;
|
||||||
|
|
Loading…
Reference in a new issue