yajra / pdo-via-oci8

PHP PDO_OCI functions via OCI8 extension
Other
88 stars 61 forks source link

Library should also support more standard DSNs #41

Closed scottchiefbaker closed 4 years ago

scottchiefbaker commented 7 years ago

I'm attempting to use this library and I ran in to a snag with the DSN. The documentation doesn't mention what the DSN syntax for OCI is, so I had to guess. Looking through the code I found a sample DSN but that's not the most intuitive way to figure out the solution.

I believe the library should be updated to handle more standard DSN connection strings in addition to the OCI specific string it already understands. From the various PHP PDO documentation pages I found the following DSN strings:

mysql:host=localhost;port=3307;dbname=testdb
mssql:host=localhost;dbname=testdb
sybase:host=localhost;dbname=testdb
dblib:host=localhost;dbname=testdb
pgsql:host=localhost;port=5432;dbname=testdb

This format could be easily parsed out, and support for both types of DSNs could be obtained.

Alternately, modifying the README to include a sample DSN and connect string would be very helpful.

yajra commented 6 years ago

Sorry for overlooking this. Will try to implement this when I got the chance but if you can, please do not hesitate to submit a PR. Thanks!

wernerm commented 4 years ago

With https://github.com/yajra/pdo-via-oci8/pull/72 been merged, this issue may be closed?