Skip to content

Commit 9c81723

Browse files
committed
Update readme and changelog
1 parent bb167ec commit 9c81723

File tree

3 files changed

+138
-138
lines changed

3 files changed

+138
-138
lines changed

CHANGELOG.md

Lines changed: 90 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
### Added
9+
- Official support for PostgreSQL.
10+
- It is now possible to bind and set binary column values in a prepared statement which is executed multiple times.
11+
12+
### Changed
13+
- Moved to `DevTheorem` namespace.
14+
- Rewrote library using PDO instead of driver-specific connection objects.
15+
Rather than instantiating a `Mysql` or `SqlServer` subclass, simply construct
16+
`PeachySql` with the PDO object for your connection.
17+
18+
> [!IMPORTANT]
19+
> If using SQL Server, make sure your PDO connection has the `PDO::SQLSRV_ATTR_FETCHES_NUMERIC_TYPE`
20+
> option set to `true`, so column values are returned with the same native types as before.
21+
22+
- When using MySQL, the `Statement` object no longer has a `getInsertId()` method.
23+
This does not affect shorthand insert methods, however, which provide the insert IDs just like before.
24+
- The `getAffected()` method on a select query result now returns the number of selected rows instead of `-1` for MySQL.
25+
- PHP 8.1+ is now required.
26+
27+
### Removed
28+
- All previously deprecated methods.
29+
- Unnecessary `$length` parameter from `makeBinaryParam()`.
30+
- `SqlException` no longer has properties for the failed query and params.
31+
32+
733
## [6.3.1] - 2024-10-13
834
### Changed
935
- Improved `makeBinaryParam()` implementation for SQL Server.
@@ -66,13 +92,12 @@ bound params in the base select query.
6692
## [5.5.1] Differentiated Bit - 2017-11-09
6793
### Added
6894
- Support for using `makeBinaryParam()` with nullable columns
69-
(issue [#5](https://github.com/theodorejb/peachy-sql/issues/5)).
95+
(issue [#5](https://github.com/devtheorem/peachy-sql/issues/5)).
7096

7197

7298
## [5.5.0] Null Appreciation - 2017-10-19
7399
### Added
74-
- New `nu` and `nn` shorthand operators to filter where a column is or
75-
is not null.
100+
- New `nu` and `nn` shorthand operators to filter where a column is or is not null.
76101

77102
### Deprecated
78103
- Ability to use null values with `eq` and `ne` operators.
@@ -83,35 +108,30 @@ is not null.
83108
- `makeBinaryParam()` method.
84109

85110
### Fixed
86-
- `Statement::getAffected()` method now consistently returns -1 when no
87-
affected count is available.
111+
- `Statement::getAffected()` method now consistently returns -1 when no affected count is available.
88112
- "Incorrect integer value" MySQL error when binding a false value.
89113

90114

91115
## [5.3.1] Deprecation Proclamation - 2017-01-31
92116
### Changed
93-
- Updated readme to document `offset()` method instead of deprecated
94-
`paginate()` method.
117+
- Updated readme to document `offset()` method instead of deprecated `paginate()` method.
95118

96119
### Deprecated
97120
- Unnecessary option getter/setter methods (`setTable()`, `getTable()`,
98-
`setAutoIncrementValue()`, `getAutoIncrementValue()`, `setIdColumn()`,
99-
`getIdColumn()`).
121+
`setAutoIncrementValue()`, `getAutoIncrementValue()`, `setIdColumn()`, `getIdColumn()`).
100122

101123

102124
## [5.3.0] Descending Increase - 2016-11-04
103125
### Added
104-
- `Selector::offset()` method to enable setting an offset that isn't a
105-
multiple of the page size.
126+
- `Selector::offset()` method to enable setting an offset that isn't a multiple of the page size.
106127

107128
### Deprecated
108129
- `Selector::paginate()` method.
109130

110131

111132
## [5.2.3] Protracted Refinement - 2016-08-28
112133
### Added
113-
- Support for generating filters with IS NOT NULL and multiple LIKE
114-
operators.
134+
- Support for generating filters with IS NOT NULL and multiple LIKE operators.
115135

116136

117137
## [5.2.2] Chainable Reparation - 2016-08-25
@@ -124,8 +144,7 @@ operators.
124144

125145
## [5.2.1] Simple Safety - 2016-07-21
126146
### Changed
127-
- An exception is now thrown when attempting to use pagination without
128-
sorting rows.
147+
- An exception is now thrown when attempting to use pagination without sorting rows.
129148
- Qualified column identifiers are now automatically escaped. As a
130149
consequence, column names containing periods are no longer supported.
131150

@@ -139,8 +158,7 @@ and also removes the need for implementation-specific options. The new
139158
`selectFrom()` method also supports pagination and more complex sorting/filtering.
140159

141160
### Deprecated
142-
- Old shorthand methods (`select()`, `insertBulk()`, `insertOne()`, `update()`,
143-
and `delete()`)
161+
- Old shorthand methods (`select()`, `insertBulk()`, `insertOne()`, `update()`, and `delete()`)
144162

145163

146164
## [5.1.0] Futuristic Resourcefulness - 2016-04-15
@@ -165,10 +183,9 @@ to run the prepared query multiple times with different values.
165183
### Changed
166184
- Column names are now automatically escaped, so shorthand methods can
167185
be used without having to specify a list of valid columns.
168-
- Rather than passing options to the PeachySQL constructor as an
169-
associative array, an `Options` subclass should be passed instead.
170-
This object has setters and getters for each setting, which improves
171-
discoverability and refactoring.
186+
- Rather than passing options to the PeachySQL constructor as an associative array,
187+
an `Options` subclass should be passed instead. This object has setters and getters
188+
for each setting, which improves discoverability and refactoring.
172189

173190
### Removed
174191
- `setConnection()` and `setOptions()` methods. Options can still be
@@ -182,7 +199,7 @@ increment value was altered.
182199
## [4.0.2] Preparatory Fixture - 2015-05-11
183200
### Fixed
184201
- Missing error info for MySQL prepared statement failures
185-
(issue [#4](https://github.com/theodorejb/peachy-sql/issues/4)).
202+
(issue [#4](https://github.com/devtheorem/peachy-sql/issues/4)).
186203

187204
### Removed
188205
- Unnecessary `SqlResult::getQuery()` method.
@@ -196,22 +213,18 @@ increment value was altered.
196213

197214
## [4.0.0] Economical Alternator - 2015-02-06
198215
### Added
199-
- `SqlResult::getIterator()` method which returns a `Generator`, making
200-
it possible to iterate over very large result sets without running into
201-
memory limitations.
216+
- `SqlResult::getIterator()` method which returns a `Generator`, making it possible to iterate over
217+
very large result sets without running into memory limitations.
202218
- Optional third parameter on `select()` method which accepts an array of
203219
column names to sort by in ascending order.
204-
- `SqlException::getSqlState()` method which returns the standard SQLSTATE
205-
code for the failure.
220+
- `SqlException::getSqlState()` method which returns the standard SQLSTATE code for the failure.
206221

207222
### Changed
208-
- `SqlException::getMessage()` now includes the SQL error message for the
209-
failed query.
223+
- `SqlException::getMessage()` now includes the SQL error message for the failed query.
210224
- `SqlException::getCode()` now returns the MySQL or SQL Server error code.
211225

212226
### Removed
213-
- PHP 5.4 support (5.5+ is now required - recent versions of HHVM should
214-
also work if using MySQL).
227+
- PHP 5.4 support (5.5+ is now required - recent versions of HHVM should also work if using MySQL).
215228
- Deprecated `insert()` and `insertAssoc()` methods.
216229
- Deprecated `TSQL` class.
217230
- Ability to call `SqlResult::getFirst()` and `SqlResult::getAll()` multiple
@@ -220,15 +233,14 @@ times for a given result (since rows are no longer cached in the object).
220233

221234
## [3.0.1] Uniform Optimization - 2014-12-06
222235
### Changed
223-
- Improved documentation consistency
224-
- Minor code cleanup and performance tweaks
236+
- Improved documentation consistency.
237+
- Minor code cleanup and performance tweaks.
225238

226239

227240
## [3.0.0] Hyperactive Lightyear - 2014-12-02
228241
### Added
229-
- `insertOne()` and `insertBulk()` methods, which accept an associative array
230-
of columns/values and return `InsertResult` and `BulkInsertResult` objects,
231-
respectively.
242+
- `insertOne()` and `insertBulk()` methods, which accept an associative array of
243+
columns/values and return `InsertResult` and `BulkInsertResult` objects, respectively.
232244
- It is now possible to bulk-insert an arbitrarily large set of rows.
233245
PeachySQL will automatically batch large inserts to remove limitations
234246
on the maximum number of bound parameters and rows per query.
@@ -242,10 +254,9 @@ The following classes have been renamed to improve API consistency:
242254
- `SQLResult` is now `SqlResult`
243255
- `MySQLResult` is now `MysqlResult`
244256

245-
Since class and function names in PHP are case-insensitive (as are file
246-
names on some platforms), these renames do not necessarily break
247-
backwards compatibility. However, existing references should still be
248-
updated to avoid confusion.
257+
Since class and function names in PHP are case-insensitive (as are file names on some platforms),
258+
these renames do not necessarily break backwards compatibility. However, existing references should
259+
still be updated to avoid confusion.
249260

250261
### Deprecated
251262
- `insertAssoc()` method - use `insertOne()` instead.
@@ -278,34 +289,29 @@ to retrieve the error array, SQL query string, and bound parameters.
278289

279290
### Changed
280291
- The library is now namespaced under `PeachySQL`.
281-
- Callbacks for shorthand methods are now optional. If no callback is
282-
specified, the methods will return sensible defaults (e.g. `select()`
283-
returns selected rows, `insert()` returns insert IDs, and `update()` and
284-
`delete()` return the number of affected rows).
292+
- Callbacks for shorthand methods are now optional. If no callback is specified, the methods will
293+
return sensible defaults (e.g. `select()` returns selected rows, `insert()` returns insert IDs,
294+
and `update()` and `delete()` return the number of affected rows).
285295
- A list of valid columns must now be passed to the options array to
286296
generate queries which reference a column. This allows queries to be
287297
generated from user data without the potential for SQL injection attacks.
288298
- Callbacks are now passed a `SQLResult` object, rather than separate
289299
arguments for selected and affected rows.
290-
- Table name and identity column options are now passed to the
291-
constructor as an associative array.
300+
- Table name and identity column options are now passed to the constructor as an associative array.
292301
- If a flat array of values is passed to `insert()`, the insert ID will
293302
now be returned as an integer instead of an array.
294303
- Updated code to follow the [PSR-2 coding style guide](http://www.php-fig.org/psr/psr-2/).
295304

296305
### Removed
297306
- `$dbType` argument from constructor (use `new PeachySQL\MySQL($conn)`
298307
or `new PeachySQL\TSQL($conn)` instead).
299-
- `getTableName()` and `setTableName()` methods (replaced with `getOptions()`
300-
and `setOptions()`).
301-
- `$idCol` parameter from `insert()` method (specify via options array
302-
instead if using SQL Server).
308+
- `getTableName()` and `setTableName()` methods (replaced with `getOptions()` and `setOptions()`).
309+
- `$idCol` parameter from `insert()` method (specify via options array instead if using SQL Server).
303310
- `splitRows()` method (not core to PeachySQL's goal). The same functionality is
304311
available in the [ArrayUtils library](https://github.com/theodorejb/array-utils).
305312

306313
## Fixed
307-
- Potential error when inserting into a MySQL table without an
308-
auto-incremented column.
314+
- Potential error when inserting into a MySQL table without an auto-incremented column.
309315
- Errors are now thrown if required table/column names aren't specified.
310316

311317

@@ -321,10 +327,8 @@ inserting a single row into a MySQL table with a flat array.
321327
## [1.1.0] - 2014-04-11
322328
### Changed
323329
- The `query()`, `select()`, `insert()`, `update()`, and `delete()` methods now
324-
return the value of their callback function, making it easier to use
325-
data outside the callback.
326-
- A flat array of values can now be passed to the `insert()` method to
327-
insert a single row.
330+
return the value of their callback function, making it easier to use data outside the callback.
331+
- A flat array of values can now be passed to the `insert()` method to insert a single row.
328332

329333

330334
## [1.0.1] - 2014-03-28
@@ -338,33 +342,33 @@ insert a single row.
338342
- Initial release
339343

340344

341-
[6.3.1]: https://github.com/theodorejb/peachy-sql/compare/v6.3.0...v6.3.1
342-
[6.3.0]: https://github.com/theodorejb/peachy-sql/compare/v6.2.0...v6.3.0
343-
[6.2.0]: https://github.com/theodorejb/peachy-sql/compare/v6.1.0...v6.2.0
344-
[6.1.0]: https://github.com/theodorejb/peachy-sql/compare/v6.0.3...v6.1.0
345-
[6.0.3]: https://github.com/theodorejb/peachy-sql/compare/v6.0.2...v6.0.3
346-
[6.0.2]: https://github.com/theodorejb/peachy-sql/compare/v6.0.1...v6.0.2
347-
[6.0.1]: https://github.com/theodorejb/peachy-sql/compare/v6.0.0...v6.0.1
348-
[6.0.0]: https://github.com/theodorejb/peachy-sql/compare/v5.5.1...v6.0.0
349-
[5.5.1]: https://github.com/theodorejb/peachy-sql/compare/v5.5.0...v5.5.1
350-
[5.5.0]: https://github.com/theodorejb/peachy-sql/compare/v5.4.0...v5.5.0
351-
[5.4.0]: https://github.com/theodorejb/peachy-sql/compare/v5.3.1...v5.4.0
352-
[5.3.1]: https://github.com/theodorejb/peachy-sql/compare/v5.3.0...v5.3.1
353-
[5.3.0]: https://github.com/theodorejb/peachy-sql/compare/v5.2.3...v5.3.0
354-
[5.2.3]: https://github.com/theodorejb/peachy-sql/compare/v5.2.2...v5.2.3
355-
[5.2.2]: https://github.com/theodorejb/peachy-sql/compare/v5.2.1...v5.2.2
356-
[5.2.1]: https://github.com/theodorejb/peachy-sql/compare/v5.2.0...v5.2.1
357-
[5.2.0]: https://github.com/theodorejb/peachy-sql/compare/v5.1.0...v5.2.0
358-
[5.1.0]: https://github.com/theodorejb/peachy-sql/compare/v5.0.0...v5.1.0
359-
[5.0.0]: https://github.com/theodorejb/peachy-sql/compare/v4.0.2...v5.0.0
360-
[4.0.2]: https://github.com/theodorejb/peachy-sql/compare/v4.0.1...v4.0.2
361-
[4.0.1]: https://github.com/theodorejb/peachy-sql/compare/v4.0.0...v4.0.1
362-
[4.0.0]: https://github.com/theodorejb/peachy-sql/compare/v3.0.1...v4.0.0
363-
[3.0.1]: https://github.com/theodorejb/peachy-sql/compare/v3.0.0...v3.0.1
364-
[3.0.0]: https://github.com/theodorejb/peachy-sql/compare/v2.1.0...v3.0.0
365-
[2.1.0]: https://github.com/theodorejb/peachy-sql/compare/v2.0.0...v2.1.0
366-
[2.0.0]: https://github.com/theodorejb/peachy-sql/compare/v1.1.1...v2.0.0
367-
[1.1.1]: https://github.com/theodorejb/peachy-sql/compare/v1.1.0...v1.1.1
368-
[1.1.0]: https://github.com/theodorejb/peachy-sql/compare/v1.0.1...v1.1.0
369-
[1.0.1]: https://github.com/theodorejb/peachy-sql/compare/v1.0.0...v1.0.1
370-
[1.0.0]: https://github.com/theodorejb/peachy-sql/tree/v1.0.0
345+
[6.3.1]: https://github.com/devtheorem/peachy-sql/compare/v6.3.0...v6.3.1
346+
[6.3.0]: https://github.com/devtheorem/peachy-sql/compare/v6.2.0...v6.3.0
347+
[6.2.0]: https://github.com/devtheorem/peachy-sql/compare/v6.1.0...v6.2.0
348+
[6.1.0]: https://github.com/devtheorem/peachy-sql/compare/v6.0.3...v6.1.0
349+
[6.0.3]: https://github.com/devtheorem/peachy-sql/compare/v6.0.2...v6.0.3
350+
[6.0.2]: https://github.com/devtheorem/peachy-sql/compare/v6.0.1...v6.0.2
351+
[6.0.1]: https://github.com/devtheorem/peachy-sql/compare/v6.0.0...v6.0.1
352+
[6.0.0]: https://github.com/devtheorem/peachy-sql/compare/v5.5.1...v6.0.0
353+
[5.5.1]: https://github.com/devtheorem/peachy-sql/compare/v5.5.0...v5.5.1
354+
[5.5.0]: https://github.com/devtheorem/peachy-sql/compare/v5.4.0...v5.5.0
355+
[5.4.0]: https://github.com/devtheorem/peachy-sql/compare/v5.3.1...v5.4.0
356+
[5.3.1]: https://github.com/devtheorem/peachy-sql/compare/v5.3.0...v5.3.1
357+
[5.3.0]: https://github.com/devtheorem/peachy-sql/compare/v5.2.3...v5.3.0
358+
[5.2.3]: https://github.com/devtheorem/peachy-sql/compare/v5.2.2...v5.2.3
359+
[5.2.2]: https://github.com/devtheorem/peachy-sql/compare/v5.2.1...v5.2.2
360+
[5.2.1]: https://github.com/devtheorem/peachy-sql/compare/v5.2.0...v5.2.1
361+
[5.2.0]: https://github.com/devtheorem/peachy-sql/compare/v5.1.0...v5.2.0
362+
[5.1.0]: https://github.com/devtheorem/peachy-sql/compare/v5.0.0...v5.1.0
363+
[5.0.0]: https://github.com/devtheorem/peachy-sql/compare/v4.0.2...v5.0.0
364+
[4.0.2]: https://github.com/devtheorem/peachy-sql/compare/v4.0.1...v4.0.2
365+
[4.0.1]: https://github.com/devtheorem/peachy-sql/compare/v4.0.0...v4.0.1
366+
[4.0.0]: https://github.com/devtheorem/peachy-sql/compare/v3.0.1...v4.0.0
367+
[3.0.1]: https://github.com/devtheorem/peachy-sql/compare/v3.0.0...v3.0.1
368+
[3.0.0]: https://github.com/devtheorem/peachy-sql/compare/v2.1.0...v3.0.0
369+
[2.1.0]: https://github.com/devtheorem/peachy-sql/compare/v2.0.0...v2.1.0
370+
[2.0.0]: https://github.com/devtheorem/peachy-sql/compare/v1.1.1...v2.0.0
371+
[1.1.1]: https://github.com/devtheorem/peachy-sql/compare/v1.1.0...v1.1.1
372+
[1.1.0]: https://github.com/devtheorem/peachy-sql/compare/v1.0.1...v1.1.0
373+
[1.0.1]: https://github.com/devtheorem/peachy-sql/compare/v1.0.0...v1.0.1
374+
[1.0.0]: https://github.com/devtheorem/peachy-sql/tree/v1.0.0

CONTRIBUTING.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ If you'd like to help out, you've come to the right place!
55

66
## Dev environment setup
77

8-
1. Clone the repository: `git clone [email protected]:theodorejb/peachy-sql.git`
8+
1. Install and enable PDO driver for one or more of MySQL, PostgreSQL, or SQL Server.
99
2. Install dependencies: `composer install`
1010

1111
## Tests
1212

1313
From a console in the working directory, execute `composer test` to run all unit tests.
1414

15-
### Database setup
15+
> [!NOTE]
16+
> By default, database tests will attempt to run on a database named `PeachySQL`.
17+
> To override connection settings, create a `LocalConfig.php` class in the `test/src`
18+
> directory which extends `Config` and overrides the desired methods.
1619
17-
By default, database tests for MySQL will attempt to run on a database named
18-
`PeachySQL` as the root user with a blank password. To override connection settings,
19-
create a `LocalConfig.php` class in the `test/src` directory which extends `Config`
20-
and overrides the desired methods.
20+
## Formatting and static analysis
2121

22-
## Static analysis
23-
24-
Run `composer analyze` to detect type-related errors before runtime.
22+
* Run `composer cs-fix` to format code following PER Coding Style.
23+
* Run `composer analyze` to detect type-related errors before runtime.

0 commit comments

Comments
 (0)