Coder Social home page Coder Social logo

Comments (5)

schuemie avatar schuemie commented on June 5, 2024

querySql currently does not alter the variable names, but in all OHDSI packages we now have the convention that after calling querySql we will automatically convert snake_case to camelCase.

If we don't do that, but follow your suggestion that we simply convert camel_case to UPPER_CASE_SNAKE_CASE, the consequence would be that all our R code will now have a mixture of naming conventions. Variables derived from a database would be SNAKE_CASE, while other variables would use camelCase. This gets really complicated when DATABASE_VARIABLES are modified in R. Should they then still be SNAKE_CASE, or camelCase?

The current solution guarantees we have only 1 naming convention in SQL, and only 1 in R.

from databaseconnector.

vojtechhuser avatar vojtechhuser commented on June 5, 2024

The current version calls toupper(). Unless I am reading something wrong.

Do we want this to stay or be removed ?
I think it currently DOES alter the variable names!!!

image

from databaseconnector.

chrisknoll avatar chrisknoll commented on June 5, 2024

If it changes, we'll have a significant amount of re-write to do, and apps will break until the rewrite is complete. If we want to make this change, it's going to have to be done in a special branch, and all dependent apps will need to coordinate all their releases based on this change.

from databaseconnector.

schuemie avatar schuemie commented on June 5, 2024

Ah yes, I forgot about the ucase. The reason why I added is that some dbmss convert all names to upper case, some convert all to lower case, and some maintain the case of the original 'create table' statement. At least with the ucase, behavior across platforms is consistent.

Note that SqlRender's snakeCaseToCamelCase function ignores the case of the input. Most code would therefore be unaffected if we remove this.

Could you give me a use case why the ucase should be removed? Remember that this means that behavior will then be different across platforms, and the user will need to deal with that.

from databaseconnector.

vojtechhuser avatar vojtechhuser commented on June 5, 2024

OK. I am glad that I was correct in reading the current code.
I vote for leaving everything as is.

BUT - we should clearly say that users should expect always uppercased output when using DatabaseConnect querySql()

from databaseconnector.

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.