@@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
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
+
7
33
## [ 6.3.1] - 2024-10-13
8
34
### Changed
9
35
- Improved ` makeBinaryParam() ` implementation for SQL Server.
@@ -66,13 +92,12 @@ bound params in the base select query.
66
92
## [ 5.5.1] Differentiated Bit - 2017-11-09
67
93
### Added
68
94
- 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 ) ).
70
96
71
97
72
98
## [ 5.5.0] Null Appreciation - 2017-10-19
73
99
### 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.
76
101
77
102
### Deprecated
78
103
- Ability to use null values with ` eq ` and ` ne ` operators.
@@ -83,35 +108,30 @@ is not null.
83
108
- ` makeBinaryParam() ` method.
84
109
85
110
### 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.
88
112
- "Incorrect integer value" MySQL error when binding a false value.
89
113
90
114
91
115
## [ 5.3.1] Deprecation Proclamation - 2017-01-31
92
116
### 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.
95
118
96
119
### Deprecated
97
120
- Unnecessary option getter/setter methods (` setTable() ` , ` getTable() ` ,
98
- ` setAutoIncrementValue() ` , ` getAutoIncrementValue() ` , ` setIdColumn() ` ,
99
- ` getIdColumn() ` ).
121
+ ` setAutoIncrementValue() ` , ` getAutoIncrementValue() ` , ` setIdColumn() ` , ` getIdColumn() ` ).
100
122
101
123
102
124
## [ 5.3.0] Descending Increase - 2016-11-04
103
125
### 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.
106
127
107
128
### Deprecated
108
129
- ` Selector::paginate() ` method.
109
130
110
131
111
132
## [ 5.2.3] Protracted Refinement - 2016-08-28
112
133
### 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.
115
135
116
136
117
137
## [ 5.2.2] Chainable Reparation - 2016-08-25
@@ -124,8 +144,7 @@ operators.
124
144
125
145
## [ 5.2.1] Simple Safety - 2016-07-21
126
146
### 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.
129
148
- Qualified column identifiers are now automatically escaped. As a
130
149
consequence, column names containing periods are no longer supported.
131
150
@@ -139,8 +158,7 @@ and also removes the need for implementation-specific options. The new
139
158
` selectFrom() ` method also supports pagination and more complex sorting/filtering.
140
159
141
160
### Deprecated
142
- - Old shorthand methods (` select() ` , ` insertBulk() ` , ` insertOne() ` , ` update() ` ,
143
- and ` delete() ` )
161
+ - Old shorthand methods (` select() ` , ` insertBulk() ` , ` insertOne() ` , ` update() ` , and ` delete() ` )
144
162
145
163
146
164
## [ 5.1.0] Futuristic Resourcefulness - 2016-04-15
@@ -165,10 +183,9 @@ to run the prepared query multiple times with different values.
165
183
### Changed
166
184
- Column names are now automatically escaped, so shorthand methods can
167
185
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.
172
189
173
190
### Removed
174
191
- ` setConnection() ` and ` setOptions() ` methods. Options can still be
@@ -182,7 +199,7 @@ increment value was altered.
182
199
## [ 4.0.2] Preparatory Fixture - 2015-05-11
183
200
### Fixed
184
201
- 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 ) ).
186
203
187
204
### Removed
188
205
- Unnecessary ` SqlResult::getQuery() ` method.
@@ -196,22 +213,18 @@ increment value was altered.
196
213
197
214
## [ 4.0.0] Economical Alternator - 2015-02-06
198
215
### 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.
202
218
- Optional third parameter on ` select() ` method which accepts an array of
203
219
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.
206
221
207
222
### 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.
210
224
- ` SqlException::getCode() ` now returns the MySQL or SQL Server error code.
211
225
212
226
### 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).
215
228
- Deprecated ` insert() ` and ` insertAssoc() ` methods.
216
229
- Deprecated ` TSQL ` class.
217
230
- 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).
220
233
221
234
## [ 3.0.1] Uniform Optimization - 2014-12-06
222
235
### Changed
223
- - Improved documentation consistency
224
- - Minor code cleanup and performance tweaks
236
+ - Improved documentation consistency.
237
+ - Minor code cleanup and performance tweaks.
225
238
226
239
227
240
## [ 3.0.0] Hyperactive Lightyear - 2014-12-02
228
241
### 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.
232
244
- It is now possible to bulk-insert an arbitrarily large set of rows.
233
245
PeachySQL will automatically batch large inserts to remove limitations
234
246
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:
242
254
- ` SQLResult ` is now ` SqlResult `
243
255
- ` MySQLResult ` is now ` MysqlResult `
244
256
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.
249
260
250
261
### Deprecated
251
262
- ` insertAssoc() ` method - use ` insertOne() ` instead.
@@ -278,34 +289,29 @@ to retrieve the error array, SQL query string, and bound parameters.
278
289
279
290
### Changed
280
291
- 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).
285
295
- A list of valid columns must now be passed to the options array to
286
296
generate queries which reference a column. This allows queries to be
287
297
generated from user data without the potential for SQL injection attacks.
288
298
- Callbacks are now passed a ` SQLResult ` object, rather than separate
289
299
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.
292
301
- If a flat array of values is passed to ` insert() ` , the insert ID will
293
302
now be returned as an integer instead of an array.
294
303
- Updated code to follow the [ PSR-2 coding style guide] ( http://www.php-fig.org/psr/psr-2/ ) .
295
304
296
305
### Removed
297
306
- ` $dbType ` argument from constructor (use ` new PeachySQL\MySQL($conn) `
298
307
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).
303
310
- ` splitRows() ` method (not core to PeachySQL's goal). The same functionality is
304
311
available in the [ ArrayUtils library] ( https://github.com/theodorejb/array-utils ) .
305
312
306
313
## 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.
309
315
- Errors are now thrown if required table/column names aren't specified.
310
316
311
317
@@ -321,10 +327,8 @@ inserting a single row into a MySQL table with a flat array.
321
327
## [ 1.1.0] - 2014-04-11
322
328
### Changed
323
329
- 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.
328
332
329
333
330
334
## [ 1.0.1] - 2014-03-28
@@ -338,33 +342,33 @@ insert a single row.
338
342
- Initial release
339
343
340
344
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
0 commit comments