Coder Social home page Coder Social logo

Comments (7)

chris-martin avatar chris-martin commented on August 18, 2024 1

In case anyone else needs it, my quick workaround was to change

Rel8.unsafeCastExpr (Rel8.nextval "foo.bar")

to

Rel8.unsafeLiteral "nextval('foo.bar')"

from rel8.

ocharles avatar ocharles commented on August 18, 2024

Thanks, I think we're going to need to change the type of nextval to something like Either QualifiedName Name in order to fix this (though I think we'd introduce a specific sum-type here, rather than using Either). @shane-circuithub any thoughts?

from rel8.

elldritch avatar elldritch commented on August 18, 2024

Yeah this might be a big breaking change but I'd love to have arguments typed something like

data RelationName = RelationName {
  schema :: Maybe Text,
  name :: Text
}

instance IsString RelationName

wherever we have functions where getting a name argument wrong can cause an ERROR: relation _ does not exist.

from rel8.

shane-circuithub avatar shane-circuithub commented on August 18, 2024

Sorry, missed this. Yeah I agree with @elldritch, some sort of type like that would be best. TableSchema could use it too, so that TableSchema becomes just RelationName and the columns.

from rel8.

chris-martin avatar chris-martin commented on August 18, 2024

This caused an outage for me 😬

from rel8.

ocharles avatar ocharles commented on August 18, 2024

@chris-martin Ack, as in upgrading Rel8 and getting #217 caused the outage?

from rel8.

chris-martin avatar chris-martin commented on August 18, 2024

Yeah, I upgraded 1.4.0 to 1.4.1, and I had one insert involving nextVal that stopped working.

In retrospect I guess I should have had golden tests on the statement ByteString that would have forced me to look over the changes to the statement when upgrading. Not sure I would have noticed the problem even if I'd seen it, though, because I didn't know that the SQL quoting worked this way.

from rel8.

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.