- add support for full text search (#235)
- add support for IDENTITY columns (#243)
- consolidate schema options formatting (#241)
- add support for invisible columns (#240)
- add support for change streams using Blueprint (#230)
- add support for snapshot queries (#215)
- deprecate Connection::getDatabaseContext() and move logic to UseMutations::getMutationExecutor() (#227)
- add support for
Query\Builder::whereNotInUnnest(...)
(#225) Query\Builder::whereIn
will now wrap values inUNNEST
if the number of values exceeds the limit (950). (#226)- Commit options can now be set through config or through
Connection::setCommitOptions(...)
(#229) - improve PHPStan support (#244)
Note
Minimum supported Laravel version is bumped to 11.15.0 for #224.
- Fixed an issue where Schema changes were applied twice. (#224)
Fixed
- phpstan error for string('column', 'MAX') (#223)
Fixed
- updateOrInsert signature change in 11.10 (#216)
Fixed
- Timestamp bound queries were not applied when in transaction (#213)
Added
- Request and Transaction tagging support (#206)
- Support for
INSERT OR IGNORE
(#207) - Support adding request timeout at query level (#208)
Fixed
- authCache needs namespace for each connection (#210)
Added
- Laravel 11 Support (#200)
- The following deprecated methods have been removed
Schema\Builder::getAllTables()
Schema\Builder::getIndexListing()
Schema\Grammar::compileTableExists()
Schema\Grammar::compileGetAllTables()
Schema\Grammar::compileColumnListing()
Schema\Grammar::compileIndexListing()
Query\Processor::processColumnListing()
Query\Processor::processIndexListing()
Blueprint::decimal()
can no longer specifyunsigned
flag.
- The following deprecated methods have been removed
Added
- Support for
Query\Builder::upsert()
(#203)
Changed
Schema\Builder::dropAllTables
returns immediately if no tables exist (#193)- Performance enhancements for
DB::pretend
statements, no longer incurring the overhead of creating transactions (#191) - Set the
$defaultMorphKeyType
inSchema\Builder
touuid
(#192)
Fixed
Connection::escapeString
now properly escapes backslashes (#197)
Added
json
mediumText
longText
char
support forSchema\Builder
(#155) (#158)Schema\Grammar::compileDropForeign
to allow dropping foreign key constraints (#163)Schema\Builder::dropAllTables
works properly, dropping foreign keys, indexes, then tables in order of interleaving (#161)- Support for inserting and selecting array of DateTime/Numeric objects (#168)
- Allow pretending for DDL statements (#170)
- Allow
spanner_emulator.disable_query_null_filtered_index_check
to be set (#180) - Allow default max transaction attempts to be changed (#179)
- Table prefixing support (#172)
- Support for
GENERATE_UUID()
in migrations (#174) - Support
Schema\Blueprint::increments()
by using a column of typeSTRING(36)
withDEFAULT (GENERATE_UUID())
(#175) - Support for
CREATE SEQUENCE
in migrations (#181)
Changed
- [Breaking] Timestamps no longer respect the date format specified in Grammar (#168)
Query\Builder::lock()
no longer throw an error and will be ignored instead (#156)Schema\Builder::getIndexListing()
Schema\Grammar::compileIndexListing()
converted togetIndexes()
andcompileIndexes()
to align with standard Laravel methods (#161)- Missing primary key will no longer be checked and will be checked on the server side instead (#177)
- [Breaking]
Connection::runDdl()
andConnection::runDdls()
has been removed. UseConnection::runDdlBatch()
instead. (#178) - [Breaking] Trait
ManagesStaleReads
has been removed (which containedcursorWithTimestampBound()
andselectWithTimestampBound()
. UseselectWithOptions()
instead). (#178) - [Breaking]
Blueprint::interleave()
andIndexDefinition::interleave()
now throw an error instead of a deprecation. (#178) - [Breaking]
Connection::transaction()
's$attempts
argument's default value was changed from 10 to -1 (which is a magic number for default value which is 11) (#179) - [Breaking] All upper case functions and casting
DATE
TIMESTAMP
CURRENT_TIMESTAMP()
has been changed to lower case for consistency. (#182)
Fixed
Schema\Grammar::compileAdd()
Schema\Grammar::compileChange()
now create separate statements (#159)Connection::runDdlBatch()
with empty statement now return an empty array instead of throwing an error (#169)
Fixed
- Fixed an error when rolling back a transaction that did not execute begin (#166)
Fixed
- Bug where auth and session pool writing to the same file may cause race condition (#152)
Added
- Add support for NUMERIC column type. (#145)
Fixed
- Match internals so that it lines up with laravel 10.34.0. (#150)
Added
- Add Data Boost support (#131)
- Deprecation warnings to
Connection
's methodscursorWithTimestampBound
selectWithTimestampBound
selectOneWithTimestampBound
. UsecursorWithOptions
selectWithOptions
instead. (#122) Connection
has new methodsselectWithOptions
cursorWithOptions
which allows spanner specific options to be set for each query. (#122)session:list
command can now show and filter by labels. (#134)- Allow custom cache path (#142)
Changed
- [Breaking] Match
Query\Builder::forceIndex()
behavior with laravel's (forceIndex
property no longer exists). (#114) - [Breaking] SessionNotFoundErrorMode was removed and will always run clear session pool. (#132) (#130)
- [Breaking] Auth cache and Session pool now share the same file cache adapter (#139)
Fixed
- Explicitly stage/clear transaction on commit to correctly run afterCommit jobs in Laravel >= v10.32.0 (#144)
Fixed
- Fixed a case where queries were not being retried on "Session Not Found" errors when session pool is undefined (#129)
Fixed
- Escape list for
Query/Builder::toRawSql
(#127)
Added
- Added deprecation warnings to
Connection::runDdl
andConnection::runDdls
(#98) - Added
ManagesMutations::insertOrUpdateUsingMutation
andUsesMutations::insertOrUpdateUsingMutation
to do upserts (#109) - Added Support for
Schema\Builder::dropIfExists()
(#115) - Added support for adding row deletion policy when modifying table (#124)
- Added Support for
Query\Builder::toRawSql()
(#123)
Changed
Connection::waitForOperation
andConnection::isDoneOperation
has been removed. (#99)- Update
export-ignore
entries in.gitattributes
(#104) - Use abstract definitions on traits instead of relying on
@methods
@property
. (#120) - Stop using
call_user_func
(#121)
Fixed
- Transaction state was not being cleared if rolled back failed. (#107)
- Column was not escaped for clause
REPLACE ROW DELETION POLICY
(#125)
Added
- Added
Connection::runDdlBatch
which runs DDLs in batch synchronously. (#86) - Added emulator support for
Connection::listSessions
. (#88) - Added
Schema\Grammar::typeDouble
for better compatibility. (#97)
Fixed
- Fixed bug where running
Connection::statement
with DDLs was not logging and was not triggering events. (#86) - FilesystemAdapter was not creating the directory for the cache file with proper permissions. (#93)
Changed
- Use google-cloud-php's CacheSessionPool since the concerned bug has been fixed in v1.53. (#90)
- Separate session pool and authentication per connection so transaction works properly. (#89)
- SessionPool and AuthCache now writes to
storage/framework/spanner/{$name}-{auth|session}
. (#93)
updated composer.json to only support laravel 10
Fixed
Connection::reconnectIfMissingConnection
was changed fromprotected
topublic
to match laravel 10. (#77)- Query/Expression changed from
(string)$expr
to$expr->getValue($grammar)
. (#77) - Applied QueryException constructor change to
Schema/Grammar
. (#77)
Changed
- Checks that primary key is defined in schema and throws an exception if not defined. (#58)
Colopl\Spanner\Session
has been renamed toColopl\Spanner\SessionInfo
.Blueprint::stringArray
's$length
parameter is now optional and defaults to255
.- Auth and session pool no longer use the custom FileCacheAdapter and uses Symfony's FilesystemAdapter instead. (#63)
- Path for auth and session pool files have moved from
storage/framework/cache/spanner
tostorage/framework/spanner/{auth|session}
. (#63) - Default Session Not Found Error Mode was changed from
MAINTAIN_SESSION_POOL
toCLEAR_SESSION_POOL
(wasn't fully confident at the time, but I think it should be safe to assume it's working now). - Schema\Builder::getAllTables() now returns rows with
name
andtype
fields instead of list of strings (was implemented incorrectly). (#73) - Exception previously thrown in
Query/Builder
forsharedLock
,lockForUpdate
,insertGetId
was moved toQuery/Grammar
. (#76) - Query/Builder::lock will now throw
BadMethodCallException
if called. Was ignored in previous versions. (#76) - [Breaking Change] Commands are now only avaiable in cli mode (#81)
- Connections will now be closed after every job has been processed in the queue. (#80)
Refactored
- Rollback handling has been refactored to better readability. (#79)
Added
- Support
Blueprint::text
(translates toSTRING(MAX)
).
Chore
- Removed
ramsey/uuid
from composer.json since laravel already includes it.
Fixed
- Expressions given as $value in
Schema\Grammar::formatDefaultValue
will now go throughgetValue
to match upstream (No behavioral change).
Fixed
Model::fresh
andModel::refresh
now adds interleaved keys to the query.- Remove Type declaration from
Query/Builder::forceIndex()
to match the one added to laravel/framework inv9.52.0
.
Added
- Command
spanner:warmup
now has a new option--skip-on-error
which will skip any connections which throws an exception.
Fixed
- Transaction state was not cleared if a NotFoundException was raised during rollback.
Added
- Support Schema\Builder::getAllTables()
- Command
spanner:cooldown
which clears all connections in the session pool. - Command
spanner:warmup
now has a new option--refresh
which will clear all existing sessions before warming up. - Command
spanner:sessions
now has a new option--sort
and--order
which allows for sorting of results.
Changed
- Default SessionPool was changed from
Google\Cloud\Spanner\Session\CacheSessionPool
toColopl\Spanner\Session\CacheSessionPool
to patch an unresolved issue on Google's end.
Fixed
- SessionPool was not cleared if php terminated immediately after calling
CacheSessionPool::clear
.
Added
- Support for default values in table columns.
- Command
spanner:sessions
which will list the sessions on the server side. - Command
spanner:warmup
which warms up sessions upto minimum number set in config. TransactionCommitting
support has been added (NOTE: this is triggered only once at root on nested transactions).- Replace and drop row deletion policy methods for Schema Builder.
- Action classes for interleave and index for IDE auto-completion.
Blueprint::interleaveInParent()
was added andBlueprint::interleave()
has been deprecated.IndexDefinition::interleaveIn()
was added andIndexDefinition::interleave()
has been deprecated.
Fixed
- Array Column's type now gets parsed in
Schema/Grammar
instead of at blueprint.
Chore
- Unnecessary folder depth has been flattened.
Added
Colopl\Spanner\Query\Builder::truncate()
is now implemented. (use to throw an error) (a171e90d3b862a3b207582ab44f0d4009e12118c)
Fixed
Colopl\Spanner\Schema\Grammar::getDateFormat()
now returns'Y-m-d\TH:i:s.uP'
instead of the default which does work correctly in Cloud Spanner. (43bffe630dbf765019674d12bf3ff3e768fe4022)Colopl\Spanner\Schema\Grammar::wrapValue()
has been extracted as trait, so it can be shared withColopl\Spanner\Query\Grammar
. (2f4347942397b9197284f342e2a345bceec12402, ca8faa1db70934fd2809e00fbd640dd711e996f2)Colopl\Spanner\Concerns\ManagesTransactions::handleBeginTransactionException()
now matches return type of parent. (7c9b5c305ab4b7e192e58af84aaa5b78caaebcb5)