Giter Club home page Giter Club logo

Comments (6)

egorpugin avatar egorpugin commented on August 24, 2024

Hi,

What result line should be?

using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::require_insert>;
or
using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::can_be_null>;
or both
using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::can_be_null, sqlpp::tag::require_insert>;
?

My current generator gives 2nd line.

from sqlpp11.

rbock avatar rbock commented on August 24, 2024

using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::can_be_null>;

This is correct (result of the linked commit, b92a9a7). I was wondering if there are versions of sqlite3 that return a string for the notnull column (that was the previous behavior). If unclear, then we should keep it this way.

from sqlpp11.

egorpugin avatar egorpugin commented on August 24, 2024

What can return column[3] == 0 here?

sqlCanBeNull = column[3] == 0 or column[3] == '0'

from sqlpp11.

rbock avatar rbock commented on August 24, 2024

The old code used column[3] == '0'. That did not work correctly on my machine since column[3] a numeric value.

That's why the new code uses column[3] == 0 in addition.

My question is: Are there versions of sqlite3 that yield a string in column[3]?

from sqlpp11.

egorpugin avatar egorpugin commented on August 24, 2024

I had always "0" in my code.
https://github.com/egorpugin/primitives/blob/master/src/tools/sqlpp11.sqlite2cpp.cpp#L222
Sqlite returns char * value 0 or 1, so I compare it with "0";

from sqlpp11.

rbock avatar rbock commented on August 24, 2024

Interesting. In python the result is numeric. At least on my machine.

Thanks for looking into it. I'll leave as is.

from sqlpp11.

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.