kohana / database

A Kohana module for database interactions, building queries, and prepared statements
http://kohanaframework.org/documentation
158 stars 140 forks source link

Accessing to connection object #34

Closed devmach closed 12 years ago

devmach commented 12 years ago

Kohana's DB module hasn't got any real support for prepared statements. If we're using PDO driver, while we're enjoying Kohana goodies, we can also have "real" prepared statements etc.

This patch basicly gives user access to connection object.

kiall commented 12 years ago

The inline docs are incorrect, the connection property may it may not be a PDO instance.

It would be more accurate to remove the PDO (and pgsql) specifics since this class is database agnostic.

kiall commented 12 years ago

(...but I would leave the usage example at L201->L205)

Kohana-Builds commented 12 years ago

Build Scheduled

cbandy commented 12 years ago

Why not just add a prepare_statement() method to Database_PDO?

Kohana-Builds commented 12 years ago

Build Passed
http://ci.kohanaframework.org/job/kohana-3.3-pull/106/

cbandy commented 12 years ago

That is, I would prefer PDO functionality be added to Database_PDO.

devmach commented 12 years ago

I'm sorry, may bad . If you think too giving access to a connection handler/link is a logical way, i'll fix inline docs and make another pull request.

useless ps: this patch was intended use in-house and other than PDO is kind of no-go, that's why it's PDO ( and postgresql centric )

devmach commented 12 years ago

@cbandy hmm, prepare_statement() method could be better

devmach commented 12 years ago

I've implemented prepare_statement() and last_insert_id() methods to Database_PDO.

Kohana-Builds commented 12 years ago

Build Scheduled

Kohana-Builds commented 12 years ago

Build Passed
http://ci.kohanaframework.org/job/kohana-3.3-pull/107/