4 ms·
> In Go switching database drivers in as simple as importing the new library. Neat! Kinda like Java. (JDBC) Kinda like C#. (IDb) Kinda like Python. (DB-API)
by paulddraper 3y ago
> In Go switching database drivers in as simple as importing the new library.
Neat!
Kinda like Java. (JDBC)
Kinda like C#. (IDb)
Kinda like Python. (DB-API)
Kinda like PHP. (PDO)
Kinda like Perl. (DBI)
Kinda like C/C++. (ODBC)
Of course, you work as the lowest common denominator and have abstractions that don't quite match the implementation. And let's be honest, how often do you switch databases.
But yeah this is very common.
---
I'd argue in practice, Java follows your advice the most of any community:
* JDBC
* Servlets
* SLF4J (not technically stdlib but very common)