Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
3c8b7cd
Add tests for PHP 7.4
Jan 9, 2021
af651d3
Fix CrudTrait fields parameter
Jan 16, 2021
3563d8d
Return object references from Collection
Jan 19, 2021
63814b0
Convert boolean values to ints
May 23, 2021
a856e9f
Log queries when debug is on
May 23, 2021
fa31d3f
Add documentation for JOINs
May 23, 2021
2029b20
update: add $limit support
GuilhermeBarile May 17, 2025
06cee75
feat: add NOT support in where conditions
GuilhermeBarile May 17, 2025
072a49a
fix: add main table reference to default primary key
GuilhermeBarile May 17, 2025
a84430f
feat: allow joining the same table more than 1 time
GuilhermeBarile May 24, 2025
27d2f84
CrudTrait refactoring/improvements
GuilhermeBarile Dec 29, 2025
e22a978
DB: Fix query `order` param
GuilhermeBarile Jan 1, 2026
cb82fdc
feat: add CI
GuilhermeBarile Feb 15, 2026
e8052e7
DBAL + Model support
GuilhermeBarile Feb 14, 2026
3bbaea4
Update JOIN syntax
GuilhermeBarile Feb 15, 2026
a5e84e5
Add SQL functions usage documentation
GuilhermeBarile Feb 15, 2026
a356176
Use the DB constructor instead of DB::connect()
GuilhermeBarile Feb 15, 2026
aaeda47
Support dotted fields in responses
GuilhermeBarile Feb 15, 2026
5a26391
fix: prepend table name when searching with pk
GuilhermeBarile Feb 15, 2026
dc5ceaa
Add tests for nested transactions
GuilhermeBarile Feb 16, 2026
f9a0183
feat: Collection Supports By Reference Iteration
GuilhermeBarile Feb 22, 2026
ff90a3a
fix: Order and Group By syntax
GuilhermeBarile Feb 22, 2026
e9a1069
feat: Add DB\Expr
GuilhermeBarile Feb 22, 2026
a8daaf7
feat: Support locks (FOR SHARE, FOR UPDATE)
GuilhermeBarile Feb 24, 2026
f9dd0c1
Support inserts with non-autoincrement pks
GuilhermeBarile Apr 21, 2026
c1d99d4
feat: Table Inheritance (v0)
GuilhermeBarile Apr 22, 2026
8b891b3
feat: Always merge `join` in Table selects, use field resolver for in…
GuilhermeBarile Apr 22, 2026
c70f2a6
feat: Support DELETE in inherited Tables
GuilhermeBarile Apr 22, 2026
2280a79
Add ensureConnection and reconnect support
GuilhermeBarile May 30, 2026
2c4904c
Drop PHP 8.1 support
objectivebot Sep 27, 2026
bf7b4ac
Expand GitHub CI database coverage
objectivebot Sep 27, 2026
a9859cf
Remove obsolete Travis CI
objectivebot Sep 27, 2026
8e36f22
Temporarily align CI to merge master
objectivebot Sep 27, 2026
90b7f69
Merge master into devel
objectivebot Sep 27, 2026
9b90959
Restore expanded GitHub CI
objectivebot Sep 27, 2026
cdb8aeb
Document Table::insert return contract
objectivebot Sep 27, 2026
357849a
Run push CI only on master
objectivebot Sep 27, 2026
466d05d
Clarify insert contracts and compatibility policy
objectivebot Sep 27, 2026
28888fa
Test all databases on supported PHP versions
objectivebot Sep 27, 2026
aaa3e44
Add 1.0 changelog
objectivebot Sep 27, 2026
8223c79
Add MIT license
objectivebot Sep 27, 2026
36ffbe4
Upgrade PHPUnit to 11.5
objectivebot Sep 27, 2026
bce739a
Update PHPUnit configuration schema
objectivebot Sep 27, 2026
d692ed4
Remove unused public error property before 1.0
objectivebot Sep 27, 2026
40c82c4
Document stable public API contracts
objectivebot Sep 27, 2026
3a871a4
Record 1.0 public API guarantee
objectivebot Sep 27, 2026
22cb9ee
Clean up package metadata for 1.0
objectivebot Sep 27, 2026
7e0d2d2
Require Doctrine DBAL 4
objectivebot Sep 27, 2026
4422edd
Document DBAL 4 compatibility
objectivebot Sep 27, 2026
78901ef
Record DBAL 4 compatibility guarantee
objectivebot Sep 27, 2026
d23a58e
Narrow WHERE parameters to arrays
objectivebot Sep 27, 2026
5e57b0f
Remove non-portable UPDATE limit
objectivebot Sep 27, 2026
ab417a6
Test portable update contract
objectivebot Sep 27, 2026
60ab9da
Remove obsolete raw WHERE rejection test
objectivebot Sep 27, 2026
5cc5970
Fix empty collection content range
objectivebot Sep 27, 2026
4e8b7e8
Test empty collection content ranges
objectivebot Sep 27, 2026
ec3ef1e
Migrate PHPUnit dependency metadata to attributes
objectivebot Sep 27, 2026
709fa24
Migrate PHPUnit dependency metadata to attributes
objectivebot Sep 27, 2026
bf89ccb
Update GitHub Actions checkout to v7
objectivebot Sep 27, 2026
9a1407b
Return collection data from render
objectivebot Sep 27, 2026
b137d60
Test collection render return contract
objectivebot Sep 27, 2026
4b99a35
Document Collection render return value
objectivebot Sep 27, 2026
63c5289
Document Query exec return semantics
objectivebot Sep 27, 2026
62299e1
Document Query exec contract
objectivebot Sep 27, 2026
1aa6800
Record Query exec compatibility contract
objectivebot Sep 27, 2026
291eee0
Test lowest compatible dependencies
objectivebot Sep 27, 2026
85c732c
Validate Composer metadata in CI
objectivebot Sep 27, 2026
8845e68
Support identifier quoting on DBAL 4.0
objectivebot Sep 27, 2026
0ae7064
Prepare compatibility policy for 0.8.0
objectivebot Sep 27, 2026
600b52d
Prepare changelog for 0.8.0
objectivebot Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 126 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,150 @@ name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
sqlite:
name: SQLite / PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.2', '8.3', '8.4']

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo_sqlite
coverage: none
tools: composer:v2

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Run tests
run: vendor/bin/phpunit
- name: Run SQLite tests
env:
TEST_DB_DRIVER: sqlite
run: vendor/bin/phpunit --testsuite sqlite

sqlite-lowest:
name: SQLite / PHP 8.2 / lowest dependencies
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: pdo_sqlite
coverage: none
tools: composer:v2

- name: Validate Composer metadata
run: composer validate --strict

- name: Install lowest compatible dependencies
run: composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction

- name: Run SQLite tests
env:
TEST_DB_DRIVER: sqlite
run: vendor/bin/phpunit --testsuite sqlite

mysql:
name: MySQL / PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4']
services:
mysql:
image: mysql:8.4
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: objectiveweb_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -proot"
--health-interval=5s
--health-timeout=5s
--health-retries=20

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo_mysql
coverage: none
tools: composer:v2

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Run MySQL tests
env:
TEST_DB_DRIVER: mysql
MYSQL_TEST_DSN: mysql:dbname=objectiveweb_test;host=127.0.0.1;port=3306;charset=utf8mb4
MYSQL_TEST_USER: root
MYSQL_TEST_PASSWORD: root
run: vendor/bin/phpunit --testsuite mysql

pgsql:
name: PostgreSQL / PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4']
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: objectiveweb_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres -d objectiveweb_test"
--health-interval=5s
--health-timeout=5s
--health-retries=20

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo_pgsql
coverage: none
tools: composer:v2

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Run PostgreSQL tests
env:
TEST_DB_DRIVER: pgsql
PGSQL_TEST_DSN: pgsql:dbname=objectiveweb_test;host=127.0.0.1;port=5432
PGSQL_TEST_USER: postgres
PGSQL_TEST_PASSWORD: postgres
run: vendor/bin/phpunit --testsuite pgsql
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog

All notable changes to this project will be documented in this file.

The project follows Semantic Versioning.

## 0.8.0

Major modernization release of Objectiveweb DB. This is a pre-1.0 release and contains breaking changes from 0.7.

### Added

- Doctrine DBAL-based database abstraction with SQLite, MySQL, and PostgreSQL support.
- Table API with CRUD operations, filtering, sorting, ranges, joins, grouping, aggregates, and row locking.
- Optional model mapping through the public `Model` extension API, with field filtering and validation rules.
- Table inheritance across base and child tables with transactional writes.
- Structured SQL expressions through the public `Expr` API.
- Transaction helpers and typed database exceptions.
- Connection health checking and reconnection support.
- Collection pagination metadata through `total()` and `contentRange()`.
- Stable `Query::exec()` semantics: DBAL `Result::rowCount()` for result-set queries and affected-row count for statement queries.
- Multi-database Docker test environment.
- GitHub Actions coverage for SQLite, MySQL, and PostgreSQL on every supported PHP version.

### Safety

- Table and field identifiers are validated before SQL generation.
- Raw string WHERE clauses are rejected.
- UPDATE and DELETE operations without conditions are rejected.
- Query values are passed through parameter bindings.

### Compatibility

- PHP 8.2, 8.3, and 8.4.
- Doctrine DBAL 4.x.
- SQLite.
- MySQL 8.4.
- PostgreSQL 16.

Doctrine DBAL 4.x compatibility is part of the Objectiveweb DB 0.8.x compatibility target.

The documented 0.8.x public API includes `Objectiveweb\\DB`, `Table`, `Collection`, `Query`, `Model`, and `Expr`, including the documented CRUD return contracts. Patch releases in the 0.8.x series should preserve these contracts.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Guilherme Barile

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading