Ruby 连接PostgreSQL

2015-01-04 0 130
Ruby 连接PostgreSQL
require 'postgres'
conn = PGconn.connect("",5432, "", "", "testdb")

conn.exec("create table rtest ( number integer default 0 );")
conn.exec("insert into rtest values ( 99 )")
res = conn.query("select * from rtest")
# res id [["99"]]

遇见资源网 ruby Ruby 连接PostgreSQL http://www.ox520.com/16242.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务