Releases: PhpGt/Database
Consistent collations
This minor release ensures that all MySQL connections are made in the same collation as the migrations are made in. This was only ever causing errors when working with variables in queries, and could be overcome in code, but has been fixed for convenience at the point that the connection is made.
Type safe fetching
This release introduces the ability to fetch single columns from the database in a type-safe way. If your query only selects one column, you can fetch it using the newly introduced type-safe functions:
- fetchBool / fetchAllBool
- fetchString / fetchAllString
- fetchInt / fetchAllInt
- fetchFloat / fetchAllFloat
- fetchDateTime / fetchAllDateTime
Along with the above, the type-safe Row function getDateTime
allows the returning of nullable fields, which removes an unintended strict rule introduced in the last release.
Upgrade of dependencies and nullable column returns
To keep backwards compatibility, when getting the value of a column from a Row using any of the get* functions, missing columns will now return null
for their value.
Row type safety
The Row
object is the most basic object your application will deal with when working with the database. A collection of getter functions has been added to Row
in this release, which allow working with type-safe data from the database, without introducing any backwards breaking changes.
The functions are simple, but powerful:
getInt
getString
getFloat
getBool
getDateTime
They are pretty self-explanatory and available right away.
Have fun and stay productive!
Stable release
The reason this repository has been waiting at v0.8 for quite a while is because the idea of returning Entity objects that extend Row
s was being worked on. It would be so useful to perform a fetch
and receive the actual object you want to work with, rather than a plain Row
object.
However, as explained in #139 , the Repository design pattern can be used to achieve this with very readable code, and without requiring any more changes to this repository itself.
That means that there are no outstanding bugs to fix or features to implement in order to perform a stable release of Database!
Have fun and keep your eye on php.gt/sqlbuilder for database templating coming your way.
January 2019 update
More tests are added in this release as the repository gets closer to stable release. As this is getting closer, the minimum-stability composer flag has been removed, meaning it no longer depends on dev releases.
December 2018 update
Many small patches and more test coverage.
Main features:
- Arrays can be used as parameter bindings, automatically concatenated with commas.
- Countable ResultSet bug fixed.
- Iterating the ResultSet does not persist the internal pointer position.
- Refactoring of special bindings code.
v0.8.2: Merge pull request #104 from PhpGt/rename-dsn-to-driver
- WebEngine specific handling of array-like objects (3dfb6a4).
toArray
implemented onResultSet
andRow
s.- Configuration is done through PHP.Gt/Config now.
- Migrations are enhanced - zero configuration does not error.
- Internal terminology change: "DSN" now referred to as "Driver".
Parameter enhancements
- Multiple iterable objects can be passed into the
query
function as variable arguments, the key-value-pairs will be merged into one parameter binding. - Bound parameters are flattened more effectively.
- SqlQuery/Query class refactoring.
Enhanced migrations
This feature release contains enhanced migration functionality, along with some small refactorings.
- More meaningful exceptions thrown when migrations are halted
- Windows compatibility
- Test edge cases of different migration file lists
- Simplify migration order rules
Client
class is more meaningfully renamed toDatabase