Document custom datasets in rom-sql
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- documentation
Research direction
Start from the issue's ROM.container(:sql, ...) example and inspect the rom-sql documentation entry points for relation datasets. Document how a relation can override dataset with a block, including what the block receives and the resulting query behavior. Done means a newcomer can find and follow the documented custom-dataset example.
Written by the indexing model from the issue text.
Description
There's no information about overridding dataset using a block, ie:
require 'rom-sql'
rom = ROM.container(:sql, 'sqlite::memory') do |config|
config.gateways[:default].create_table :users do
primary_key :id
column :name, String
column :email, String
end
config.relation(:users) do
schema do
attribute :id, ROM::SQL::Types::Serial
attribute :name, ROM::SQL::Types::String
end
dataset do |rel|
select(*rel.schema.attributes.keys).order(:id)
end
end
end
rom.relations[:users].insert(name: 'Jane')
puts rom.relations[:users].first.inspect
- Dominant language
- Ruby
- Stars
- 220
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rom-rb/rom-sql
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
バグ
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
voxpupuli/puppet-epel#186 · 1 comment ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) OpenBug Frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TheOdinProject/curriculum#31402 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100