db icon indicating copy to clipboard operation
db copied to clipboard

Expose database capabilities similar to how ActiveRecord works.

Open ioquatix opened this issue 5 years ago • 2 comments

After a discussion with @tenderlove, it looks like we could abstract https://github.com/rails/rails/blob/98d65ed19c7d3c4a0187616984deb4c3f1b9d270/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L257-L462 into a Capabilities class, which would be implemented as an attribute of an active connection and used for lowering AST and other statements into valid SQL.

ioquatix avatar Jul 07 '20 04:07 ioquatix

What does "lowering AST in valid SQL" mean?

machty avatar Oct 27 '21 12:10 machty

ActiveRecord uses an AST format for queries, and these need to be converted into strings which can be sent to the server for execution, funnily enough, almost immediately parsed back into ASTs.

The process of turning an object representing a query into a string is called lowering, since you lower th e representation to a less rich/detailed form (strings).

ioquatix avatar Oct 27 '21 19:10 ioquatix