Code Monkey home page Code Monkey logo

Comments (2)

AlekSi avatar AlekSi commented on July 21, 2024

Do you have any examples in existing ORMs?

from reform.

AlekSi avatar AlekSi commented on July 21, 2024

@m0sth8 shared some details privately. The idea is to generate SQL statements with embedded comments, so it is possible to track them from RDMS logs back to application code. Sounds like a useful feature.

How RDMS support comments:

  • PostgreSQL supports /* */ sytax without problems. Optimizer hints are not supported.
  • MySQL supports /* */ syntax. It has hacks for MySQL specific code (/*! STRAIGHT_JOIN */) with optional version check (/*!50110 KEY_BLOCK_SIZE=1024 */) and optimizer hints (/*+ BKA(t1) */) after keywords SELECT, UPDATE, etc. Internets say that comments in statements can kill query cache: 1, 2, 3.
  • SQLite3 supports /* */ syntax. Not sure about how it affects cache, but it should not be a concern for SQLite3 user.
  • Microsoft SQL Server supports /* */ syntax. Comments can kill query cache: 1, 2.
  • Oracle supports /* */ syntax with hacks for optimizer hints (/*+ ALL_ROWS */) after keywords SELECT, UPDATE, etc.

How it should be implemented is an open question. Querier looks like a natural place, but then statements like BEGIN from DB will not be logged.

from reform.

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.