How would I store data to a server?

R

Ryan Macy

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?
 
K

khaines

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 Haines
 
R

Ryan Macy

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.
 
K

khaines

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 Haines
 
J

Jan Svitok

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top