How would I store data to a server?

What would be the best way to store data to a remote database like
postgreSQL from any computer in the world, Is there a lib or binding to
do this? Or would I have to use ruby on rails with ruby to get this
effect?

On Fri, 28 Jul 2006, Ryan M. wrote:

What would be the best way to store data to a remote database like
postgreSQL from any computer in the world, Is there a lib or binding to
do this? Or would I have to use ruby on rails with ruby to get this
effect?

You absolutely do not have to use Rails to do this.

However, you would be well served to start at the beginning of the
problem.

Because you say “any computer in the world”, my assumption is that you
are
thinking about some sort of web browser based application for
transfering
the data. Is this the case, or might your goals be served by a
graphical
or command line tool installed on the computer? What kind of data do
you
need to transfer?

Once you answer these questions, you can be more effectively guided
towards your available options.

Kirk H.

Ok what I am attempting to figure out is; I want to have a gtk windows,
with said window on startup I want it too connect to a database to
retrive the user list, clans, and etc. With this data I will sort it out
on the program display the users clan, members, etc. I need to connect
to a database on my server but I do not wish to have connection
passwords and such in the code.

  1. for mysql, there is a c binding and pure ruby binding AFAIK. for
    pgsql and others, I suppose at least binary ones exist.

  2. regarding the password: if you do not want to store it in the code,
    you can obviously either ask it from user or do not ask it at all. Or,
    you can provide other means of transferring information than direct db
    connection. That wouldn’t solve the problem with password, but will
    allow you more fine-grained control. I think webservices are good for
    this - using e.g. xmlrpc you can write them pretty easily, both server
    and client (in a few lines of code for each). The server would
    probably need to run under webrick or mongrel or something similar.

J.

On Fri, 28 Jul 2006, Ryan M. wrote:

Ok what I am attempting to figure out is; I want to have a gtk windows,
with said window on startup I want it too connect to a database to
retrive the user list, clans, and etc. With this data I will sort it out
on the program display the users clan, members, etc. I need to connect
to a database on my server but I do not wish to have connection
passwords and such in the code.

I’m sure people can suggest many ways to get you there. A quick and
easy
way that occurs to me is to use Drb.

On your server you run a Drb service that provides an API for querying
that information

Take a look at this tutorial on how to approach something like this:

http://segment7.net/projects/ruby/drb/introduction.html

Kirk H.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs