Skip to content

Align with PRADO Data 4.4: insertOrIgnore and upsert statements - #12

Open
belisoful wants to merge 3 commits into
masterfrom
db-modern-exec
Open

belisoful wants to merge 3 commits into
masterfrom
db-modern-exec

Conversation

@belisoful

@belisoful belisoful commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Aligns SqlMap with PRADO's Data layer renovation for 4.4 (pradosoft/prado#1088, merged to master as da09515) and keeps this package's fixes. Each file was three-way merged against the 4.4 version; see CHANGELOG [Unreleased].

Requirements

  • Requires PRADO 4.4 ("pradosoft/prado": "^4.4@dev" until 4.4 is tagged) and PHP 8.2. The fallbacks for older cores are removed, including the PRADO 4.3 message unquoting in TSqlMapException.

Added

  • <insertOrIgnore> and <upsert> mapping elements (TSqlMapInsertOrIgnore, TSqlMapUpsert with updateColumns / conflictColumns, TInsertOrIgnoreMappedStatement, TUpsertMappedStatement). They run through TSqlMapGateway::insert() with the driver's own conflict SQL. Docs: docs/statements/upsert.md.

Changed

  • A parameter without a dbType binds with TDbCommand::getColumnTypeFromValue().
  • Paging on a connection whose command builder is not an SQL builder throws sqlmap_limit_offset_unsupported.
  • Serialization exclusions through _getZappableSleepProps().
  • The package's fixes in TMappedStatement (invokable delegates, case-insensitive column matching, LEFT JOIN groupBy) are kept over v4.4's older code.
  • CI: the SQL Server job's Microsoft repo follows the runner's Ubuntu release (as in prado-activerecord).

Tests

  • TSqlMapUpsertTest (parsing, attributes, selectKey, cache flush) and SqliteUpsertStatementTest (both tags on SQLite).
  • Local, against pradosoft/prado master: lint, cs-fixer, PHPStan, unit (213), db-sqlite (138).

@belisoful
belisoful marked this pull request as ready for review November 5, 2026 21:39
@belisoful

belisoful commented Nov 6, 2026 •

Copy link
Copy Markdown
Member Author

@ctrlaltca This is good to rebase/squash and merge.

This is mostly just adding upsert and insertOrIgnore.

If you want to tag this v1.0.1 and release, that would be good for the community but not entirely necessary because Prado v4.4/5 is not released yet; making this tag against a pre-alpha core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant