Comments (16)
BTW, slightly altering prepareLoadStatement()
to
private function prepareLoadStatement()
{
if (null === $this->loadStatement) {
- $query = 'SELECT uuid, playhead, metadata, payload, recordedOn
+ $query = 'SELECT uuid, playhead, metadata, payload, recordedOn AS "recordedOn"
FROM ' . $this->tableName . '
WHERE uuid = :uuid
ORDER BY playhead ASC';
is a simple fix that would alleviate config issues. I'd prefer to know what the root cause and solution is, but if Quandidate would like a PR that tweaks the SQL to fix it, I can submit one.
from broadway.
PostgreSQL lowercases all columns and table names unless you use double quotes.
http://stackoverflow.com/questions/13409094/why-does-postgresql-default-everything-to-lower-case
This why its recommended to always use underscore for separating words in SQL.
from broadway.
Oh jeeeeez. See now, I spent a ton of time screwing around with DBAL and didn't even think about it being Postgres doing that. This is why I shouldn't work on things after 10 hour days. Thx for the link!
from broadway.
@sstok Easily fixed in the SELECT statement. Any idea how to force the quoting in the addColumn(...)
commands when creating the table? Using double quotes or forcing escaped double quotes addColumn("\"recordedOn\""...)
doesn't seem to work.
I'll try researching when I get home tonight; was just trying to see if a quick fix worked.
from broadway.
Well, I can finally get it running under PostgreSQL, but the quoting changes that have to be made, subsequently break it in MySQL. Le Sigh. So, looks like I may need to break out a PostgresDBALEventStore class that overrides the functions and quoting needed.
from broadway.
PR #53 submitted for review
from broadway.
You mean #53 ;)
from broadway.
From what I know is that Doctrine has its own quoting strategy, so using something like "id"
will actually include the double-quotes in the name ""id""
(SQL based quote escaping).
But I'm not on this.
from broadway.
Heh whoops 53. Edited.
I couldn't get the quoting strategy to a place where it would work in both PgSQL and MySQL and I had no more time or brainpower to spend on messing around with it, so I just subclassed a PG version of the class with the proper quoting for that database. Not the most elegant of solutions and would prefer a better one, I just don't feel like spending any more time on the issue right now.
from broadway.
The other alternative is to not have the PGSQL version of the class and just simply change the SELECT to have as "recordedOn"
as indicated a couple of days ago. I haven't double checked that solution across a few different platforms yet, but should be unobtrusive.
from broadway.
In know MySQL uses backtics
for special keywords and threads
"the same as
'` when it comes to strings. I haven't worked with MySQL for a long time so I can be wrong though.
from broadway.
IMO, the best alternative would be to change column names to use underscores rather than camelCase. Given that 1.0 is not released yet, such BC break could still be done.
Dealing with column names case sensitivity will be a huge pain in the ass: http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html#.VBqV4Ba79QJ
from broadway.
@stof I agree. I was just this second about to close my previous PR and push a new one that simply adds a AS "recordedOn"
to the select statement, but if the qandidate peeps are ok with just changing the column name to recorded_on, I'll further change it
from broadway.
@asm89 @othillo @wjzijderveld Opinion on AS "recordedOn"
vs recorded_on
?
from broadway.
@mbadolato I would prefer recorded_on
as well if that is the correct fix.
from broadway.
@wjzijderveld PR 55 submitted with the change
from broadway.
Related Issues (20)
- drop test/Broadway/TestCase
- make PHPUnit a dependency HOT 5
- test the test helpers with examples HOT 2
- Built-in asynchronous way to run processors? HOT 3
- Example/explanation on event sourcing for aggregate roots HOT 1
- What is the overall state of the project? Is it GDPR ready? HOT 2
- Simple Command Bus - Manage Throwable exceptions
- Could you do a new release? HOT 2
- Are there any plans to update broadway? HOT 1
- Asymmetry between EventBus interface and EventListener interface HOT 2
- Broadway does not seem to survive hot upgrades HOT 2
- duck-typing vs interface HOT 1
- Replaying events to rebuild elastic search index HOT 1
- PHP 8 support HOT 2
- Processor after projector HOT 2
- Aggregator HOT 3
- Indirect development dependency used in src ConcurrencyConflictResolvers
- no recent tags? HOT 1
- Get uncommitted events without empty the aggregate HOT 4
- Give serializers flexibility to map based on event type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from broadway.