Visitar URL original
Releases · nette/database · GitHub
Skip to content

Releases: nette/database

Released version 3.2.10

Choose a tag to compare

@dg dg released this 27 Oct 21:50

✨ New Features

  • Ready for PHP 8.6
  • insert([]) now inserts a row of database defaults on PostgreSQL, SQLite and MS SQL too, not only on MySQL, so saving an empty form works on every engine

🐛 Bug Fixes

  • Floats keep their full value, both as bound parameters and inlined in SQL; 1/3 or 1e-11 reach the database exactly as they are in PHP
  • Selection::insert() with a list of rows returns the number of inserted rows, as documented; code that used the returned ActiveRow now gets an int (#330)
  • transaction() rethrows the original exception even when the final ROLLBACK fails, e.g. after a deadlock
  • GroupedSelection::limit() respects the offset when the selection belongs to multiple parent rows, and a Selection over a table without a primary key can be re-queried
  • Conditions skipped by a short-circuited ?and / ?or no longer leave their parameters behind
  • A where() identical to an existing JOIN condition is no longer dropped, and binary parameters no longer make distinct conditions collide
  • Row: isset() and offsetExists() give correct answers, including for falsy values
  • Reflection is more accurate across drivers: column order of composite foreign keys and indexes (MySQL, PostgreSQL), column defaults (PostgreSQL, #329), primary key and identity columns (MS SQL), tables without an explicit schema (MS SQL), autoincrement detection (SQLite) and table resolution along search_path (PostgreSQL)
  • MS SQL: identifiers containing [ or ] are escaped correctly, and offset-only or zero-limit queries generate valid SQL
  • The Tracy panel no longer shows duplicate BlueScreen SQL sections with multiple connections

🛡️ Robustness

  • Constraint violations on SQL Server, CHECK violations on SQLite and more connection-loss codes on PostgreSQL and MySQL now map to the specific exception classes
  • Misuse reports a clear exception instead of a PHP error: an unknown PDO driver, page() with less than one item per page, related() on a composite primary key, getInsertId() on a failed lazy connection, an unknown table in Reflection on SQLite, an unknown constant in the DI options; the ambiguous-reference message names the table, key and candidates
  • The DI extension detects a single connection by the presence of dsn, so key order in the config no longer matters

Released version 3.2.9

Choose a tag to compare

@dg dg released this 22 Apr 05:29

This release brings a set of focused exception types that let you catch specific database failure modes (deadlocks, lock timeouts, check constraint violations, lost connections) instead of wrestling with generic driver errors. ActiveRow and Selection now expose getExplorer() for direct access to the underlying Explorer, and the reflection layer has been refactored for more consistent metadata across drivers.

✨ New Features

  • getExplorer() – ActiveRow and Selection now expose the underlying Explorer instance, no more jumping through hoops to get back to it
  • DeadlockException – catch deadlocks and serialization failures distinctly from other driver errors, so retry logic can stay surgical
  • LockTimeoutException – a dedicated exception for lock wait timeouts
  • CheckConstraintViolationException – check constraint violations now get their own class instead of being lumped with generic constraint errors
  • ConnectionLostException – distinguish dropped connections from other driver failures, making reconnect strategies much cleaner
  • Docker Compose setup – a ready-to-run Compose configuration for spinning up test databases locally

♻️ Code Refactoring

  • Drivers reflection output – unified FK row shape across drivers, simplified MsSql getIndexes SQL, parameterized SQLite PRAGMA queries, and ForeignKey::$name is now a non-nullable string

📦 Maintenance

  • Improved PHPDoc descriptions, phpDoc types, and native type declarations across the codebase

Released version 3.2.8

Choose a tag to compare

@dg dg released this 30 Oct 20:33
  • support for PHP 8.5
  • OciDriver: in case of applyLimit with different offset returns always the same result

Released version 3.2.7

Choose a tag to compare

@dg dg released this 03 Jun 05:03
  • SqlPreprocessor: IN() inserts parameters directly and bypasses binding
  • added GroupedSelection::refreshData()
  • Reflection: added comment to Column and Table
  • Structure: removed unused parameter

Released version 3.2.6

Choose a tag to compare

@dg dg released this 12 Jan 05:20
  • fixed performance issue of ActiveRow #312
  • ConnectionPanel: added whole stack trace listing
  • ConnectionPanel: fixed source resolution
  • ConnectionPanel: table does not exceed the window
  • ConnectionPanel: convert templates to Latte-like syntax
  • Selection: factory methods moved to Explorer
  • SqlPreprocessor: added braces around where conditions
  • SqlPreprocessor: fixed bugs in WHERE
  • big refactoring of SqlPreprocessor
  • deprecated Driver::SupportSubselect
  • Selection::fixedAssoc() silently deprecated
  • SQLite: column type can be omitted #315

Released version 3.2.5

Choose a tag to compare

@dg dg released this 18 Dec 19:07
  • ResultSet: added fetchList() as alias for fetchFields() & shortcuts
  • ResultSet::fetchAssoc() returns associative array by default, added shortcuts
  • removed dead code

Released version 4.0.0 RC 1

Choose a tag to compare

@dg dg released this 29 Aug 05:10

Main Features

  • Ability to create drivers for additional PHP database extensions, not just PDO
  • Merging of Connection & Explorer
  • Improved control over data type transformation with options convertBoolean, convertDateTime, and convertDecimal

Changes

  • Connection::getInsertId() now returns integers
  • The options convertBoolean and newDateTime (returns date as Nette\Database\DateTime) are enabled by default
  • Removed interfaces IRow and IRowContainer
  • Removed methods Connection::getPdo() and getDsn()

Released version 3.2.4

Choose a tag to compare

@dg dg released this 19 Aug 01:58
  • ResultSet, Selection: fetchPairs() accepts callback
  • Selection: support for generics
  • drivers: improved getting db structure
  • Reflection improvements
  • normalizeRow(): removed extra float handling #307
  • Helpers::detectType() supports 'INT UNSIGNED'
  • md5 replaced with xxHash
  • removed return type 'never' to allow inheritance #303
  • MySQL: supportBooleans renamed to convertBoolean
  • PascalCase constants
  • MySqlDriver::initialize() removed support for 'utf8' charset before 5.5.3
  • Selection: fixed type error on empty aggregations #309
  • SqlsrvDriver::applyLimit() removed support for SQL Server < 2012
  • support for PHP 8.4

Released version 3.2.1

Choose a tag to compare

@dg dg released this 07 May 19:25
  • added reflection for Table, Column, Index, ForeignKey
  • returns date-time as immutable Nette\Database\DateTime (when 'newDateTime' is enabled) #270

Released version 3.2.0

Choose a tag to compare

@dg dg released this 05 Dec 20:44
  • requires PHP 8.1
  • added PHP 8 typehints, uses PHP 8.1 features
  • MySqlDriver: DECIMAL with precision=0 is returned as int (BC break)
  • normalizeRow: converts zero-date 0000-00-00 to NULL (BC break)
  • normalizeRow: time columns resets date to 0001-01-01 (BC break)
  • Numeric/decimal data type is detected as FIELD_DECIMAL
  • MySqlDriver: TINYINT(1) is returned as bool (when 'supportBooleans' is enabled)