pcai / safe_query Goto Github PK
View Code? Open in Web Editor NEWQuery things in ActiveRecord safely.
Home Page: https://rubygems.org/gems/safe_query
License: MIT License
Query things in ActiveRecord safely.
Home Page: https://rubygems.org/gems/safe_query
License: MIT License
safe query raises when eager loading on a resultset using #includes
that only has a single related record. this is because activerecord doesnt generate an IN clause, but rather an equals clause. safe query doesnt recognize that the generated query is bounded because the query is matching on a primary key.
the detection code should ideally figure out if the clause is equality matching on a unique column or pk so it doesnt throw on those queries
The tests at https://github.com/pcai/safe_query/blob/main/spec/activerecord/safe_query_spec.rb are missing a case mentioned in the docs
Namely, a potentially unsafe query that would normally raise an exception can be avoided by converting the relation to an array first.
This case should be explicitly tested in the specs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.