Closed tvaughan closed 9 years ago
Now that's interesting. On 0.3.7 I removed the functionality that splits up large SQL files if the database is PostgreSQL, because unlike MySQL, Postgres can handle multiple updates more robustly. But it looks like there was a limit I was unaware of.
I'll need to consider how to approach this in future. Either by taking an approach like clj-sql-up, where the migration files are written in Clojure, or by sticking with SQL and using an explicit delimiter command between SQL commands.
For now, I'd advise using 0.3.6. If you happen to have any syntax suggestions on this subject, I'd be interested to know.
We already use https://github.com/jkk/honeysql so it would be pretty natural for us to write our migrations in clojure.
Since the approach of splitting up large files works reliably for all databases, wouldn't it be better to simply continue using it with postgres as well. Is performance really that much of an issue here?
The problem is that splitting up large files isn't reliable; it doesn't work with things like stored procedures.
Another option might be to use a custom statement separator such as a comment string the way yesql does.
@weavejester @yogthos
Just ran into this problem. This answer from SO seems to solve / work around it.
BTW: do-commands
are deprecated in favor of db-do-commands
I'm hitting this with just two SQL statements in my migration file, so I'm a bit confused about the "handles more robustly" part. Perhaps I'm missing something?
Assuming that solution from SO works, would you accept a pull request replacing do-commands
with do-prepared
for the Postgres case?
@icambron #45 has been open for 40 days or so. Use https://github.com/michaelklishin/ragtime (released to Clojars as clojurewerkz/ragtime "0.4.0"
) which has a fix.
Joplin has recently switched to our fork because Ragtime isn't getting the attention it deserves.
@michaelklishin Thanks, I'll give a shot.
Unfortunately Ragtime has been at the bottom of my priority list for a while, as I haven't done anything with SQL databases in over a year. It's definitely not getting the attention it deserves.
@michaelklishin would you be open to collaborating on Ragtime?
@weavejester definitely. I'd be happy to take it over as I use Joplin quite a bit with both relational and non-relational data stores.
I can port the few fixes I have in our fork and cut a new release if you add me to the group on Clojars.
@martintrojer may be interested in joining, too.
Cool, let us now when ragtime is patched up and I'll move joplin back.
This happens in 0.3.7 and not 0.3.6. I assume this is related to this commit: https://github.com/weavejester/ragtime/commit/717360529f7af744d6c0e28fc4b601e82915e950
Any clue? Thanks!