hi...<br><br> you can try to use host to indicate which server you want to connect with.. like:<br><br>adbapi.ConnectionPool('xxx', host='localhost', user='twww',pwd='eee') <br><br><br><br>
<div class="gmail_quote">On Wed, Jul 13, 2011 at 9:08 AM, bino oetomo <span dir="ltr"><<a href="mailto:bino@indoakses-online.com">bino@indoakses-online.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear All ..<br>
<br>
Base on a need, I need to build a JSON-RPC to Postgres "bridge".<br>
For now, I try to take the ORM way, so I'm looking for ORM "engine" that<br>
work well with Twisted and support for Postgres as it's backend.<br>
<br>
First try I look into SqlAlchemy ... but there is a lot of talk that<br>
SqlAlchemy did not work well with Twisted.<br>
I found that Twistar have a support for postgres backend.<br>
<br>
All sample script I found only look like this :<br>
for MySQL driver<br>
---Start----<br>
from twisted.enterprise import adbapi<br>
from twistar.registry import Registry<br>
<br>
Registry.DBPOOL = adbapi.ConnectionPool('MySQLdb', user="twistar",<br>
passwd="apass", db="twistar")<br>
---Stop----<br>
<br>
and I thing for postgres it will be like :<br>
---Start----<br>
from twisted.enterprise import adbapi<br>
from twistar.registry import Registry<br>
<br>
Registry.DBPOOL = adbapi.ConnectionPool('psycopg2', user="twistar",<br>
passwd="apass", db="twistar")<br>
---Stop----<br>
<br>
Is that right ?<br>
If So ... where to put the db server ip address (i.e : my Postgres<br>
server is at 192.168.10.232) ?<br>
<br>
Sincerely<br>
-bino-<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br>