GithubHelp home page GithubHelp logo

Comments (4)

elliotchance avatar elliotchance commented on May 30, 2024 1

Ah yes, sorry. In a recent update (v0.2.4 - #6) to conform to the SQL standard, all regular (non-delimited) identifiers are represented in upper case. I forgot to update the example to be row.get_f64('A').

That Row actually needs some love. It should return an error with a helpful message instead of returning a misleading value:

println(row.get_f64('Foo') ?)
// no such column Foo, did you mean FOO?

Alternatively, CREATE TABLE foo ("a" FLOAT) would allow you to use row.get_f64('a').

from vsql.

spytheman avatar spytheman commented on May 30, 2024

If I change the loop to do println(row), I get:

elliotchance.vsql.vsql.Row{
    offset: 58
    data: {'A': elliotchance.vsql.vsql.Value{
        typ: FLOAT
        f64_value: 1.23
        string_value: ''
    }}
}
elliotchance.vsql.vsql.Row{
    offset: 78
    data: {'A': elliotchance.vsql.vsql.Value{
        typ: FLOAT
        f64_value: 4.56
        string_value: ''
    }}
}

so the data is there, but perhaps .get_f64() can not access it 🤔

from vsql.

spytheman avatar spytheman commented on May 30, 2024

println(row.get_f64('A')) shows the values

from vsql.

spytheman avatar spytheman commented on May 30, 2024

imho returning a helpful error is better - code is written just once, and the error will be caught in development; forcing get_f64 functions to upcase their arguments will happen in production too

from vsql.

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.