nopoco / laminas-db
Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations
Requires
- php: ~8.0.0 || ~8.1.0|| ~8.2.0
- laminas/laminas-stdlib: ^3.7.1
Requires (Dev)
- laminas/laminas-coding-standard: ^2.4.0
- laminas/laminas-eventmanager: ^3.6.0
- laminas/laminas-hydrator: ^4.7
- laminas/laminas-servicemanager: ^3.19.0
- phpunit/phpunit: ^9.5.25
Suggests
- laminas/laminas-eventmanager: Laminas\EventManager component
- laminas/laminas-hydrator: (^3.2 || ^4.3) Laminas\Hydrator component for using HydratingResultSets
- laminas/laminas-servicemanager: Laminas\ServiceManager component
Conflicts
This package is auto-updated.
Last update: 2024-12-01 00:13:44 UTC
README
Removed political appeal incompatible with free software here. The original repository is at this link.
Laminas\Db
is a component that abstract the access to a Database using an object
oriented API to build the queries. Laminas\Db
consumes different storage adapters
to access different database vendors such as MySQL, PostgreSQL, Oracle, IBM DB2,
Microsoft Sql Server, PDO, etc.
Contributing
Please be sure to read the contributor's guide for general information on contributing. This section outlines specifics for laminas-db.
Test suites
The phpunit.xml.dist
file defines two test suites, "unit test" and "integration test".
You can run one or the other using the --testsuite
option to phpunit
:
$ ./vendor/bin/phpunit --testsuite "unit test" # unit tests only $ ./vendor/bin/phpunit --testsuite "integration test" # integration tests only
Unit tests do not require additional functionality beyond having the appropriate database extensions present and loaded in your PHP binary.
Integration tests
To run the integration tests, you need databases.
The repository includes a Vagrantfile
which allows you to fire up a vagrant box with several of our target databases, including:
- MySQL
- PostgreSQL
- SQL Server
To start up vagrant:
$ vagrant up
Copy phpunit.xml.dist
to phpunit.xml
, and change the following ENV var declaration values to "true":
- TESTS_LAMINAS_DB_ADAPTER_DRIVER_MYSQL
- TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV
- TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL
- TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLITE_MEMORY
From there, you can run the integration tests:
$ ./vendor/bin/phpunit --testsuite "integration test"
- File issues at https://github.com/laminas/laminas-db/issues
- Documentation is at https://docs.laminas.dev/laminas-db/