Code Monkey home page Code Monkey logo

Comments (2)

staabm avatar staabm commented on May 27, 2024

Hey Ondrej,

thx for the feedback.

as it stands right now we are asking the database, because this gives us the ability to have a result-set schema, not just a database schema. with this metadata we are able to also infer types for aggregate functions and we also get the nullable-types on joins for free without the need to parse the actual database query.

Sometimes the database doesn't even live on the same machine where PHPStan is running.

for this case phpstan-dba supports record & replay. when replay-ing the queries we also see a 2-2.5x improved performance.

note, recording has a open issue though

I think it'd be much more interesting to download the database structure before the analysis

as mentioned above, this would not bring us on feature parity with what we have atm - I guess.

maybe we could use something like https://github.com/vimeo/php-mysql-engine to simulate a real database. but this in turn might bring us in a similar direction we already have with record&replay without additional benefits?
since there is no such engine I am aware of for other database types (e.g. pgsql) this would render phpstan-dba even more coupled to mysql which is not the best direction I think.

these are just my thoughts though, and I am open for experiements to improve phpstan-dba performance if we can.

from phpstan-dba.

ondrejmirtes avatar ondrejmirtes commented on May 27, 2024

Yeah, "record and replay" seems reasonable, thanks :)

from phpstan-dba.

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.