GithubHelp home page GithubHelp logo

Comments (2)

pmjones avatar pmjones commented on August 15, 2024

We kind of do this now with the profiler/logger. When the profiler is turned on, it captures the query text, the data bound to the query, the elapsed time, and (something i really like) a debug backtrace so you can see exactly where the query came from in the codebase. Is that sufficient?

from aura.sql.

harikt avatar harikt commented on August 15, 2024

When profiler is active , yes we get the query like the one below .

foreach($sql->getProfiler()->getProfiles() as $i => $profile ) {
    echo "Query : " . ($i+1) . "  " . $profile->text . " took " . $profile->time . PHP_EOL;
    //print_r( $profile->trace );
}

Query : 2  SELECT * FROM posts took 0.00012612342834473
Query : 3  SELECT * FROM posts Where id = :id took 0.00043177604675293
Query : 4  INSERT INTO `posts`(`title`, `author_id`, `body`) VALUES (:title, :author_id, :body) took 0.050559043884277

Problems are which I love to improve when profiler is setActive are :

1 ) You can see we cannot directly copy and paste the code and do a query some where .

So the query

  SELECT * FROM posts Where id = :id

will become

  SELECT * FROM posts Where id = 1

something like that.

2 ) Debug backtrace is an array of recursion. So when we do a print for it, that will be hard to trace it out . Is there an easy way ? May be I am missing all the functionality .

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.