我以前使用 sqlite3 作为我的 ruby 代码,它适用于以下代码
def existsCheck( db, id )
temp = db.exec( 'SELECT 1 WHERE EXISTS(
SELECT 1
FROM Products
WHERE promoID = ?
) ', [id] ).length > 0
end
def writeDB( db, product )
db.exec( 'INSERT INTO Products ( promoID, name, price, shipping, condition, grade, included, not_included, image, time_added )
VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [product.promoID, product.name, product.price, product.shipping, product.condition, product.grade, product.included, product.notIncluded, product.image, product.time] )
end
Postgresql 不支持“?”的想法?还是我做错了什么?