
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
A ruby SOQL query builder, to build salesforce query strings. It doesn't include all the available SOQL queries. Contributions are welcome.
# ruby
gem install 'soql_builder'
# rails
gem 'soql_builder'
require 'soql_builder'
builder = SoqlBuilder.new(type: :select)
Simple select query
# In the fields method you can add parent table fields, an exaple of Contract__r.Name below
builder.fields(['Name', 'Contract__r.Name'])
.from('Account')
.where('id = 1')
builder.query
=> "select Name, Contract__r.Name from Account where id = 1"
# Add a limit
builder.fields(['Name', 'Contract__r.Name'])
.from('Account')
.where('id = 1')
.limit(1)
builder.query
=> "select Name, Contract__r.Name from Account where id = 1 limit 1"
Select query with subquery
builder.fields(['Name', 'Contract__r.Name'])
.add_subquery(
table: 'Account.Quotes',
fields: ['Quotes.Name', 'Quotes.id']
)
.from('Account')
.where('id = 1')
builder.query
=> "select Name, Contract__r.Name, (select Quotes.Name, Quotes.id from Account.Quotes) from Account where id = 1"
Select query with multiple subqueries
builder.fields(['Name', 'Contract__r.Name'])
.add_subquery(
table: 'Account.Quotes',
fields: ['Quotes.Name', 'Quotes.id']
)
.add_subquery(
table: 'Account.Contacts',
fields: ['Contacts.Name']
)
.from('Account')
.where('id = 1')
builder.query
=> "select Name, Contract__r.Name, (select Quotes.Name, Quotes.id from Account.Quotes), (select Contacts.Name from Account.Contacts) from Account where id = 1"
Queries can be added one at a time, instead of chaining
builder.fields(['Name', 'Contract__r.Name'])
builder.add_subquery(
table: 'Account.Quotes',
fields: ['Quotes.Name', 'Quotes.id']
)
builder.from('Account')
builder.where('id = 1')
builder.query
=> "select Name, Contract__r.Name, (select Quotes.Name, Quotes.id from Account.Quotes) from Account where id = 1"
Reset the query and create another one with the same object
builder.fields(['Name', 'Contract__r.Name'])
builder.add_subquery(
table: 'Account.Quotes',
fields: ['Quotes.Name', 'Quotes.id']
)
builder.from('Account')
builder.where('id = 1')
builder.query
=> "select Name, Contract__r.Name, (select Quotes.Name, Quotes.id from Account.Quotes) from Account where id = 1"
builder.clean
builder.fields(['Name', 'Contract__r.Name'])
.from('Account')
.where('id = 1')
builder.query
=> "select Name, Contract__r.Name from Account where id = 1"
FAQs
Unknown package
We found that soql_builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.