Hi
Which mysql or postgres gems should be used (mysq-*, mysql2*, ruby-mysql)
to interface to the (default) Linux-packages?
No gems found for postgres???
Is it advisable to use dbi still nowadays? (Does Rails use dbi???)
- there is an extra gem rails-dbi
What do most/advanced Rubyists use?
What is easier (also to maintain) - for beginners, but suitable for a
throughput of 10 items (rows) per second?
Better to bypass dbi in those case?
Is it advisable to use dbi still nowadays? (Does Rails use dbi???)
- there is an extra gem rails-dbi
dbi seems to have been a Perl thing (?)
When I understand correctly it provides an extra layer to unify
the access to different types of databases (via different
plug-ins or adapters), and also some functionality of an
object-relational mapper (aka ORM).
You find that approach in various gems:
Sequel, active_record, DataMapper, ROM (Ruby Object Mapper), ...
(Does Rails use dbi???)
- there is an extra gem rails-dbi
Rails uses active_record by default.
rails-dbi seems to be unmaintained for several years,
and was targeted for Rails 3 -- we now have Rails 5.
Sequel is an ORM, so it's a rather different thing. It still requires a database access gem like pg.
It *is* good, if you want an ORM (although, personally, I don't get on with the Model framework).
···
-----Original Message-----
From: ruby-talk [mailto:ruby-talk-bounces@ruby-lang.org] On Behalf Of
sto.mar@web.de
Sent: 10 August 2016 2:36 pm
To: Ruby users
Subject: Re: Databases with Ruby
Am 10.08.2016 um 15:11 schrieb A Berger:
> Which mysql or postgres gems should be used (mysq-*, mysql2*,
> ruby-mysql) to interface to the (default) Linux-packages?
I heard really good things about the "sequel" gem.
It can handle MySQL, PostgreSQL, SQLite, and many other databases.
> What is easier (also to maintain) - for beginners, but suitable for a
> throughput of 10 items (rows) per second?
I would guess practically anything would work for such a low throughput.
Granted. Depends on what the OP exactly wants to do.
Personally, I like the extra bit of abstraction.
And of course, you are not forced to use Sequel::Model
and can also any time run raw SQL queries, too,
if you prefer.
Regards,
Marcus
···
Am 11.08.2016 um 09:45 schrieb Andy Jones:
Sequel is an ORM, so it's a rather different thing. It still requires a database access gem like pg.
It *is* good, if you want an ORM (although, personally, I don't get on with the Model framework).