gpt4 book ai didi

c++ - 是否有用于 C 和/或 C++ 的数据库访问库,其接口(interface)与 Perl 的 DBI 类似?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:41:09 24 4
gpt4 key购买 nike

我愿意写 Perl 的一个子集 DBI C++ 中 libodbc(或 unixODBC)的接口(interface)。我相信这样做会让我更好地专注于我的目标。

顺便说一句,如果已经有类似的东西,我宁愿避免重新发明轮子。

最佳答案

NVM,没有 odbc 接口(interface),但它类似于 DBI(因为 DBI 除了在 DBD::ODBC 中不使用 odbc)

libdbi - http://libdbi.sourceforge.net/

libdbi implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl. Writing one generic set of code, programmers can leverage the power of multiple databases and multiple simultaneous database connections by using this framework.

In order to utilize the libdbi framework, you need to install drivers for a particular type of database. The drivers officially supported by libdbi are split off into the libdbi-drivers project. The current version of libdbi (0.8.3) is supposed to work with any 0.8.x release of libdbi-drivers. Currently the following database engines are supported:

* Firebird/Interbase
* FreeTDS (provides access to MS SQL Server and Sybase)
* MySQL
* PostgreSQL
* SQLite/SQLite3

关于c++ - 是否有用于 C 和/或 C++ 的数据库访问库,其接口(interface)与 Perl 的 DBI 类似?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1288996/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com