Code Monkey home page Code Monkey logo

Comments (8)

php- avatar php- commented on August 23, 2024

@harikt @pmjones please can you take look at this?

from aura.sql.

harikt avatar harikt commented on August 23, 2024

Hi @php- ,

I am wondering how you are using @@session.time_zone . Is this a field ? Can you show exact issue on a Pull request how you are using the feature.

I can't promise I will fix it, but I can look into it.

from aura.sql.

php- avatar php- commented on August 23, 2024

For example: convert_tz(field, @@session.time_zone, to_desired_timezone), and this does not matter you use in selection or in where clause.

There are many different cases as I mentioned before like COUNT(DISTINCT field)), I think you should add config to enable/disable it. because they way it works, is really limiting some good features of SQL language.

Thanks

from aura.sql.

koriym avatar koriym commented on August 23, 2024

Hi @php-

It would be nice if you provide minimal,ย self-contained, reproducing test case that shows the problem you are reporting.

from aura.sql.

harikt avatar harikt commented on August 23, 2024

Hi @php- ,

I believe you can enable / disable it via setting the parser to NullParser .

// https://github.com/auraphp/Aura.Sql/tree/2be02d5dfd9fdee6df199de1a19572aa490bb744/src/Parser
$parser = new \Aura\Sql\Parser\NullParser();
$pdo->setParser($parser);

Remember once you unset to new parser you may want to set it again if you want to make sure other quoting related functionalities is working fine.

Hope that helps to resolve your issue / use case .

from aura.sql.

francislavoie avatar francislavoie commented on August 23, 2024

Is this still relevant? It seems to work fine now for me ๐Ÿค”

image

image

from aura.sql.

php- avatar php- commented on August 23, 2024

@francislavoie yes, issue still exists. The query you run might not have issues, but when you use builder like:

$query = $queryFactory->newSelect();
$query->from("customer");
$query->cols(['convert_tz(open_from, customer.time_zone, @@session.time_zone) open_now']);
$query->where('customer.id=123');

from aura.sql.

tbreuss avatar tbreuss commented on August 23, 2024

@francislavoie yes, issue still exists. The query you run might not have issues, but when you use builder like:

$query = $queryFactory->newSelect(); $query->from("customer"); $query->cols(['convert_tz(open_from, customer.time_zone, @@session.time_zone) open_now']); $query->where('customer.id=123');

Sorry, but your code example has no reference to aura/sql. There is no query builder in this package.

from aura.sql.

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.