2017-03-03 69 views

回答

0

我發現你可以添加returning id到查詢字符串。即

DB = PG.connect dbname: 'mydb', user: 'myuser' 
res = DB.exec "insert into ..." 
id = res.first['id'] 

Source

相關問題