Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose database capabilities similar to how ActiveRecord works. #2

Open
ioquatix opened this issue Jul 7, 2020 · 2 comments
Open

Comments

@ioquatix
Copy link
Member

ioquatix commented Jul 7, 2020

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.

@machty
Copy link

machty commented Oct 27, 2021

What does "lowering AST in valid SQL" mean?

@ioquatix
Copy link
Member Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants