Using a Database without Rails

As a noob I want to play around with databases using Ruby, not Rails. I've
already searched on Google, but I didn't find much help (old, broken links
to gems). I've also checked out stack overflow, but I didn't find what I
was looking for.

I want to write a simple Ruby (not Rails) application that stores user data
in a database and query that database. I've looked into Active Record but
it looks like this is Rails (I want to stay away from Rails for now).

Any pointers?

Sequel is awesome and pretty popular: http://sequel.jeremyevans.net/
I like it since it doesn't smother you with excessive
layers of indirection; you can use lower-level SQL functionality
easily and you don't have to use the ORM modeling stuff; just
basic Ruby objects.

···

Marc Chanliau <marc.chanliau@gmail.com> wrote:

As a noob I want to play around with databases using Ruby, not Rails. I've
already searched on Google, but I didn't find much help (old, broken links
to gems). I've also checked out stack overflow, but I didn't find what I
was looking for.

You can use activerecord as a gem without rails. There are other orm gems
as well. Search for ruby orm gems.
You also have gems for nosql databases.
Like mongodb or redis

···

On Sunday, 22 May 2016, Marc Chanliau <marc.chanliau@gmail.com> wrote:

As a noob I want to play around with databases using Ruby, not Rails. I've
already searched on Google, but I didn't find much help (old, broken links
to gems). I've also checked out stack overflow, but I didn't find what I
was looking for.

I want to write a simple Ruby (not Rails) application that stores user
data in a database and query that database. I've looked into Active Record
but it looks like this is Rails (I want to stay away from Rails for now).

Any pointers?

Hi
That's called ORM. You can try datamapper or sequel. I think Active Record
is good, and in fact you can use it without rails.
Tsung-en

···

2016/05/22 12:01 "Marc Chanliau" <marc.chanliau@gmail.com>:

As a noob I want to play around with databases using Ruby, not Rails. I've
already searched on Google, but I didn't find much help (old, broken links
to gems). I've also checked out stack overflow, but I didn't find what I
was looking for.

I want to write a simple Ruby (not Rails) application that stores user
data in a database and query that database. I've looked into Active Record
but it looks like this is Rails (I want to stay away from Rails for now).

Any pointers?

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Try starting with simply persisting (storing) to YAML files. Sometimes
removing the abstraction helps understanding. Can you build a fast index?

/KDR

···

***
Kevin D. Rollins
Technology * Economics * Writing
@kevinrollins

On Sun, May 22, 2016 at 12:07 AM, Tsung-en Hsiao <joshua841025@gmail.com> wrote:

Hi
That's called ORM. You can try datamapper or sequel. I think Active Record
is good, and in fact you can use it without rails.
Tsung-en
2016/05/22 12:01 "Marc Chanliau" <marc.chanliau@gmail.com>:

As a noob I want to play around with databases using Ruby, not Rails.
I've already searched on Google, but I didn't find much help (old, broken
links to gems). I've also checked out stack overflow, but I didn't find
what I was looking for.

I want to write a simple Ruby (not Rails) application that stores user
data in a database and query that database. I've looked into Active Record
but it looks like this is Rails (I want to stay away from Rails for now).

Any pointers?

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Quoting Tsung-en Hsiao (joshua841025@gmail.com):

   That's called ORM. You can try datamapper or sequel. I think Active Record
   is good, and in fact you can use it without rails.

Or, if you already know your way in SQL and want to use your knowledge
in the most direct way, install SQLite3 and the relative Ruby gem. See

SQLite comes with a lot of good-quality documentation:

http://www.sqlite.org/docs.html

Carlo

···

Subject: Re: Using a Database without Rails
  Date: dom 22 mag 16 12:07:16 +0800

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Carlo, I'll try SQLite first (I'm very familiar with sql).
Thx

···

Sent from my iPhone. Pardon brevity and possible typos.

On May 21, 2016, at 9:45 PM, Carlo E. Prelz <fluido@fluido.as> wrote:

   Subject: Re: Using a Database without Rails
   Date: dom 22 mag 16 12:07:16 +0800

Quoting Tsung-en Hsiao (joshua841025@gmail.com):

  That's called ORM. You can try datamapper or sequel. I think Active Record
  is good, and in fact you can use it without rails.

Or, if you already know your way in SQL and want to use your knowledge
in the most direct way, install SQLite3 and the relative Ruby gem. See

GitHub - sparklemotion/sqlite3-ruby: Ruby bindings for the SQLite3 embedded database

SQLite comes with a lot of good-quality documentation:

SQLite Documentation

Carlo

--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

YAML is something I need to learn so thx for the suggestion.

···

Sent from my iPhone. Pardon brevity and possible typos.

On May 21, 2016, at 9:40 PM, Kevin Rollins <kevin.d.rollins@gmail.com> wrote:

Try starting with simply persisting (storing) to YAML files. Sometimes removing the abstraction helps understanding. Can you build a fast index?

/KDR

***
Kevin D. Rollins
Technology * Economics * Writing
@kevinrollins

On Sun, May 22, 2016 at 12:07 AM, Tsung-en Hsiao <joshua841025@gmail.com> wrote:
Hi
That's called ORM. You can try datamapper or sequel. I think Active Record is good, and in fact you can use it without rails.
Tsung-en

2016/05/22 12:01 "Marc Chanliau" <marc.chanliau@gmail.com>:

As a noob I want to play around with databases using Ruby, not Rails. I've already searched on Google, but I didn't find much help (old, broken links to gems). I've also checked out stack overflow, but I didn't find what I was looking for.

I want to write a simple Ruby (not Rails) application that stores user data in a database and query that database. I've looked into Active Record but it looks like this is Rails (I want to stay away from Rails for now).

Any pointers?

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

sequel with SQLite sounds like something that could get me started.
Thx

···

Sent from my iPhone. Pardon brevity and possible typos.

On May 21, 2016, at 9:39 PM, Eric Wong <e@80x24.org> wrote:

Marc Chanliau <marc.chanliau@gmail.com> wrote:

As a noob I want to play around with databases using Ruby, not Rails. I've
already searched on Google, but I didn't find much help (old, broken links
to gems). I've also checked out stack overflow, but I didn't find what I
was looking for.

Sequel is awesome and pretty popular: http://sequel.jeremyevans.net/
I like it since it doesn't smother you with excessive
layers of indirection; you can use lower-level SQL functionality
easily and you don't have to use the ORM modeling stuff; just
basic Ruby objects.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

also look at postgresql and the pg gem

···

On Sun, 2016-05-22 at 08:55 -0700, Marc Chanliau wrote:

Carlo, I'll try SQLite first (I'm very familiar with sql).
Thx

All the usual suspects for databases have built-in support in Ruby:

- json
- xml

If you want to write queries in actual sql, the sequel and activerecord do it for you

- sql

Also, built-in support in Ruby for the very lean and elegant:

- yaml
- csv

I've read the subject line with a big smile. It sounded like heresy, but true ... because I heard Tesla, the car company, sells batteries without the car. Ruby actually runs without Rails. And you can do databases without SQL. I even can write a letter without Adobe InDesign. Oh my god, I can even do web development without a Mac! Okay, the last one is heresy, indeed.

TTS

···

On Sun, 22 May 2016 08:56:53 -0700 Marc Chanliau <marc.chanliau@gmail.com> wrote:

YAML is something I need to learn so thx for the suggestion.

--
Our problems are manmade; therefore, they can be solved by man.---JFK 1963.

All the usual suspects for databases have built-in support in Ruby:

- json
- xml

If you want to write queries in actual sql, the sequel and activerecord do it for you

- sql

Also, built-in support in Ruby for the very lean and elegant:

- yaml
- csv

I've read the subject line with a big smile. It sounded like heresy, but true ... because I heard Tesla, the car company, sells batteries without the car. Ruby actually runs without Rails. And you can do databases without SQL. I even can write a letter without Adobe InDesign. Oh my god, I can even do web development without a Mac! Okay, the last one is heresy, indeed.

TTS

···

On Sun, 22 May 2016 08:56:53 -0700 Marc Chanliau <marc.chanliau@gmail.com> wrote:

YAML is something I need to learn so thx for the suggestion.

--
Our problems are manmade; therefore, they can be solved by man.---JFK 1963.

You could also have a look at https://github.com/rom-rb/rom

Thanks for the answer, Tom. Not sure if it's sarcasm or not. The reason for
using Ruby with a database doesn't look very heretic to me. I've done that
many times with Java, so what seems to be the problem? Rails is not what
I'm learning now, Ruby is. It so happens that I'm very proficient in
database technology (of any kind) and I want to experiment with a small
database application using Ruby. Not sure what's wrong with that. I'm not
asking questions on this list to be derided.
Thanks all the same.

···

On Mon, May 23, 2016 at 3:27 PM, Tom <athena.ispe@gmail.com> wrote:

All the usual suspects for databases have built-in support in Ruby:

- json
- xml

If you want to write queries in actual sql, the sequel and activerecord do
it for you

- sql

Also, built-in support in Ruby for the very lean and elegant:

- yaml
- csv

I've read the subject line with a big smile. It sounded like heresy, but
true ... because I heard Tesla, the car company, sells batteries without
the car. Ruby actually runs without Rails. And you can do databases without
SQL. I even can write a letter without Adobe InDesign. Oh my god, I can
even do web development without a Mac! Okay, the last one is heresy, indeed.

TTS

On Sun, 22 May 2016 08:56:53 -0700 > Marc Chanliau <marc.chanliau@gmail.com> wrote:

> YAML is something I need to learn so thx for the suggestion.
>
--
Our problems are manmade; therefore, they can be solved by man.---JFK 1963.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

I think sequel is a good choice and you can find it here(
https://rubygems.org/gems/sequel\). Sequel is a lightweight database
interface you can take many advantages of it.

Marc Chanliau <marc.chanliau@gmail.com>于2016年5月24日周二 上午7:52写道:

···

Thanks for the answer, Tom. Not sure if it's sarcasm or not. The reason
for using Ruby with a database doesn't look very heretic to me. I've done
that many times with Java, so what seems to be the problem? Rails is not
what I'm learning now, Ruby is. It so happens that I'm very proficient in
database technology (of any kind) and I want to experiment with a small
database application using Ruby. Not sure what's wrong with that. I'm not
asking questions on this list to be derided.
Thanks all the same.

On Mon, May 23, 2016 at 3:27 PM, Tom <athena.ispe@gmail.com> wrote:

All the usual suspects for databases have built-in support in Ruby:

- json
- xml

If you want to write queries in actual sql, the sequel and activerecord
do it for you

- sql

Also, built-in support in Ruby for the very lean and elegant:

- yaml
- csv

I've read the subject line with a big smile. It sounded like heresy, but
true ... because I heard Tesla, the car company, sells batteries without
the car. Ruby actually runs without Rails. And you can do databases without
SQL. I even can write a letter without Adobe InDesign. Oh my god, I can
even do web development without a Mac! Okay, the last one is heresy, indeed.

TTS

On Sun, 22 May 2016 08:56:53 -0700 >> Marc Chanliau <marc.chanliau@gmail.com> wrote:

> YAML is something I need to learn so thx for the suggestion.
>
--
Our problems are manmade; therefore, they can be solved by man.---JFK
1963.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Please remove me from this list.

I'm not advanced enough to understand what all of you are discussing.

I've tried to unsubscribe, but it hasn't worked.

Thanks.
Lori

Lori Bard
Lori@bardfamily.org
650-867-2067
I hope you're having a fantastic day

···

On May 23, 2016, at 10:31 PM, timlen tse <tinglenxan@gmail.com> wrote:

I think sequel is a good choice and you can find it here(https://rubygems.org/gems/sequel\). Sequel is a lightweight database interface you can take many advantages of it.

Marc Chanliau <marc.chanliau@gmail.com>于2016年5月24日周二 上午7:52写道:

Thanks for the answer, Tom. Not sure if it's sarcasm or not. The reason for using Ruby with a database doesn't look very heretic to me. I've done that many times with Java, so what seems to be the problem? Rails is not what I'm learning now, Ruby is. It so happens that I'm very proficient in database technology (of any kind) and I want to experiment with a small database application using Ruby. Not sure what's wrong with that. I'm not asking questions on this list to be derided.
Thanks all the same.

On Mon, May 23, 2016 at 3:27 PM, Tom <athena.ispe@gmail.com> wrote:
All the usual suspects for databases have built-in support in Ruby:

- json
- xml

If you want to write queries in actual sql, the sequel and activerecord do it for you

- sql

Also, built-in support in Ruby for the very lean and elegant:

- yaml
- csv

I've read the subject line with a big smile. It sounded like heresy, but true ... because I heard Tesla, the car company, sells batteries without the car. Ruby actually runs without Rails. And you can do databases without SQL. I even can write a letter without Adobe InDesign. Oh my god, I can even do web development without a Mac! Okay, the last one is heresy, indeed.

TTS

On Sun, 22 May 2016 08:56:53 -0700 >>> Marc Chanliau <marc.chanliau@gmail.com> wrote:

> YAML is something I need to learn so thx for the suggestion.
>
--
Our problems are manmade; therefore, they can be solved by man.---JFK 1963.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

I'd say you stay on the list and get a primer from
https://lagunita.stanford.edu/
http://www.theodinproject.com/courses?ref=home_b

Simply because I'm going through the Odin Project at this moment: Chapter
9, Section Basic Databases in "Beginning Ruby - From Novice to
Professional" is what you're looking for. The book is a little "old" but
the basics probably haven't changed much(?).

Best,
Matt Bymaster

···

On Tue, May 24, 2016 at 1:53 PM, Tom <athena.ispe@gmail.com> wrote:

I'd say you stay on the list and get a primer from
https://lagunita.stanford.edu/
http://www.theodinproject.com/courses?ref=home_b

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;