Closed nkottary closed 8 years ago
The intent is to have a query type which represents a query to be executed with many parameters, and those parameters are passed as a field in the query type.
One of the big mistakes of DBI.jl was having prepared statements in the interface. Prepared statement semantics differ wildly between database systems and the idea of a "prepared statement" isn't a consistent one. I am strongly against including any functions dealing with prepared statements in DBAPI.jl.
As for metadata: the better option, which I am exploring in PostgreSQL.jl, is to have a result set type. This can be both returned from execute, and stored in the cursor (the result of the last query run on the cursor). Any metadata can be encapsulated within or made available through that type.
Added methods
prepare
andbind
to support prepared statements. This helps improve performance when the same query has to be executed repeatedly with different parameters. The query can be prepared once usingprepare
and every time it is used new parameters can be bound to it usingbind
.Also added a type
Metadata
and a methodmetadata
to retrieve metadata of the result set afterexecute!
.