MySQL/Ruby: More documentation or examples?

Discussion in 'Ruby' started by Phillip Gawlowski, Mar 22, 2007.

  1. Hello, list.

    I'm digging my way through the MySQL/Ruby documentation[0], which is,
    sadly, a bit lacking, at least for my still weak understanding of Ruby
    and MySQL. I can't check the Japanese version, as I don't speak Japanese
    myself.

    Although I have found Paul DuBois' short introduction to Mysql/Ruby[1],
    which got me started a bit, at least, my google-fu is weak, and only
    turns up (more or less) RoR related cruft.

    Right now, I'm poking the different methods with the help of irb, but
    that's not really helping (Although now I know that
    Mysql::Result#fetch_row() goes to the next row of a result set,
    apparently, pending further investigation).

    That being said, is there more detailed coverage of the MySQL/Ruby
    module available? If so, where can I find it? The project's website
    provides the same information as the README within the gem, unfortunately.


    Bibliography:
    [0] http://www.tmtm.org/en/mysql/ruby/
    [1] http://www.kitebird.com/articles/ruby-mysql.html

    --
    Phillip "CynicalRyan" Gawlowski

    Rule of Open-Source Programming #4:

    If you don't work on your project, chances are that no one will.
     
    Phillip Gawlowski, Mar 22, 2007
    #1
    1. Advertising

  2. Makoto Inada wrote:
    > I know this is not a straight answer, but you may want to check
    > ActiveRecord in RoR. It works standalone nicely outside of the framework.


    Probably a good idea, but unfortunately I cannot abstract the Database
    too much.
    1.) I didn't develop the database myself, and working with it from a
    pure SQL POV is a pain in the neck. I can't imagine the problems I'm
    going to have to wrestle
    2.) Those who did have no real clue what the benefits of an SQL Database
    are (a VARCHAR field is set as an INDEX, for example, I have yet to see
    a FOREIGN KEY, and the column itemid in one table could be named item_id
    in the next, while containing the same data, and so on..).

    And thirdly, but more importantly, I want to bring my SQL skills up to
    speed, too. I don't want to handle just the usual suspects of SQL
    statements, but broaden my skillset a little more towards DBA.

    And I really, really cannot add another thing to my "things to learn to
    do a good job of it" list. Before I tackle *anything* related to Rails,
    I want to write fluent and *good* Ruby first.


    --
    Phillip "CynicalRyan" Gawlowski

    Rule of Open-Source Programming #34:

    Every successful project will eventually spawn a sub-project
     
    Phillip Gawlowski, Mar 22, 2007
    #2
    1. Advertising

  3. On Fri, Mar 23, 2007 at 12:10:55AM +0900, Phillip Gawlowski wrote:
    > Makoto Inada wrote:
    > >I know this is not a straight answer, but you may want to check
    > >ActiveRecord in RoR. It works standalone nicely outside of the framework.

    >
    > Probably a good idea, but unfortunately I cannot abstract the Database
    > too much.


    You might also want to look at ruby-dbi. This gives a small abstraction
    layer on top of the native database adapter; this means you can learn just
    one API and use it to send SQL to Mysql, Oracle, Sqlite etc (of course, the
    SQL statements that you send may be different for each of those databases)

    You also might find better documentation or examples. A quick google for
    "ruby-dbi" turns up a number of introductory documents and examples. The
    first hit is
    http://www.kitebird.com/articles/ruby-dbi.html

    HTH,

    Brian.
     
    Brian Candler, Mar 22, 2007
    #3
  4. Brian Candler wrote:

    >
    > You might also want to look at ruby-dbi. This gives a small abstraction
    > layer on top of the native database adapter; this means you can learn just
    > one API and use it to send SQL to Mysql, Oracle, Sqlite etc (of course, the
    > SQL statements that you send may be different for each of those databases)
    >
    > You also might find better documentation or examples. A quick google for
    > "ruby-dbi" turns up a number of introductory documents and examples. The
    > first hit is
    > http://www.kitebird.com/articles/ruby-dbi.html


    Thanks, I'll take a look at it tomorrow.

    A first glance reveals that it isn't too different from MySQL/Ruby, but
    much more accessible. It's, at least, intriguing (especially interfacing
    to several different databases).

    --
    Phillip "CynicalRyan" Gawlowski

    Rule of Open-Source Programming #9:

    Give me refactoring or give me death!
     
    Phillip Gawlowski, Mar 22, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boris Boutillier
    Replies:
    0
    Views:
    1,030
    Boris Boutillier
    Jun 15, 2004
  2. Stuart D. Gathman

    Documentation examples needed

    Stuart D. Gathman, Jul 17, 2003, in forum: Python
    Replies:
    5
    Views:
    360
    Dave Kuhlman
    Jul 19, 2003
  3. Michael
    Replies:
    4
    Views:
    473
    Matt Hammond
    Jun 26, 2006
  4. Randy Lawrence

    mysql-ruby or ruby-mysql?

    Randy Lawrence, May 23, 2004, in forum: Ruby
    Replies:
    3
    Views:
    123
    Randy Lawrence
    May 24, 2004
  5. Robert Klemme

    With a Ruby Yell: more, more more!

    Robert Klemme, Sep 28, 2005, in forum: Ruby
    Replies:
    5
    Views:
    242
    Jeff Wood
    Sep 29, 2005
Loading...

Share This Page