Coder Social home page Coder Social logo

Comments (8)

weavejester avatar weavejester commented on June 9, 2024

The whole SQL parser needs to be replaced with something more reliable, it's just a case of finding time to do it. Even something as simple as separating SQL statements is just too prone to edge cases.

from ragtime.

 avatar commented on June 9, 2024

@rkneufeld I had similar issues with the parsing of stored procedures... it motivated me to take a different approach and avoid the complexity of parsing sql files... you might take a look at this ( https://github.com/ckuttruff/clj-sql-up ) - which works as you'd expect with more complicated sql syntax

from ragtime.

weavejester avatar weavejester commented on June 9, 2024

Out of interest, @ckuttruff, what made you decide to create a migration plugin rather than hook into Ragtime?

from ragtime.

 avatar commented on June 9, 2024

Hey @weavejester
I originally had that intention with this PR ( #18 ), but it seemed like not the best approach given the way things were currently structured with ragtime and the expectation of specifying migrations as sql files. The way of modeling migration statements as a vector of sql strings seemed much simpler (avoiding the necessary parsing logic), but obviously would be a breaking paradigm shift for ragtime.

Apologies if this was perceived as a lack of desire to contribute to ragtime... that is certainly not the case. Given my limited clojure experience, and the need to maintain backwards compatibility, it was much simpler for me to attack the issue from a blank slate

from ragtime.

weavejester avatar weavejester commented on June 9, 2024

Ragtime doesn't have an opinion on how migrations are specified. You just need to provide it with a function that returns a sequence of migration maps.

Presumably you wrote clj-sql-up from scratch because you were unaware of that?

from ragtime.

 avatar commented on June 9, 2024

hmm, well I actually wrote clj-sql-up for a variety of reasons; it was a great learning opportunity amongst other things.

But no, I was not aware aware of an alternative method for specifying migration content beyond sql files; was just going off the documentation here: https://github.com/weavejester/ragtime/wiki/Getting-Started#migrations20120903221323-add-test-tableupsql which just specifies creating plain sql files under a migrations directory.

Thanks for the prompt response and sorry if there was more I could have done to contribute to ragtime; just wanted to mention an alternate solution on this issue thread that doesn't run into some of the parsing issues that @rkneufeld and others have encountered in this particular situation.

from ragtime.

weavejester avatar weavejester commented on June 9, 2024

No need to apologise! I was just curious as to your reasoning, as that would give me an idea of what could be improved.

The Ragtime README could do a better job at explaining the library, and how different migration strategies could be used.

from ragtime.

weavejester avatar weavejester commented on June 9, 2024

Should be fixed by version 0.4.0 redesign.

from ragtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.