什么是 ODBC 以及如何利用它 (Linux)?

发布于 2024-09-02 16:05:34 字数 290 浏览 0 评论 0原文

我正在使用 SQLite 创建主数据库。这个文件包含十几个表。我希望我的组中的每个人都可以访问它(通过 Python 或通过 SQLite 命令行),并且我正在考虑简单地将文件放入组可读目录中并将其命名为“master.db”。

现在,我想到了流行词“ODBC”。

我记得我以前使用 Windows 的日子(感谢上帝,它们已经消失了),当时我可以“注册”并将 Excel 电子表格添加到我的“数据源”中;它将在任何应用程序中可见。

我可以在 Linux 世界中利用这一点吗?这有什么意义吗?

非常感谢。

I am creating a master database using SQLite. This single file contains a dozen tables. I want everybody in my group to have access to it (either through Python or through the SQLite command line) and I was thinking of simply putting the file in a group readable directory and calling it 'master.db'.

Now, the buzz word 'ODBC' comes to mind.

I remember my old Windows days (thank God they're gone), when I could "register" and Excel spreadsheet into my "data sources"; it would be made visible from within any application.

Can I take advantage of this in the Linux world? Does this make any sense?

Many thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

胡渣熟男 2024-09-09 16:05:34

如果只有少数人访问您的数据库那么您应该没问题。然而,SQlite 在大量并发访问方面表现不佳 - 当我有大量并发访问时,我从 sqlite 切换到 mysql,因为数据库一直被锁定。

对于许多并发访问,您需要在中间有一些东西来承受请求的冲击,比如一个(小型)网络服务器,甚至是一个可以接受所有这些请求并可以调节对 sqlite 数据库的访问的 python 程序。使用像 SQLAlchemy 或 SQLObject 这样可以以线程安全方式访问 sqlite 的 ORM。

至于在 Linux 上使用 odbc 使 sqlite 作为数据源可供 Linux 用户访问,而 ODBC 当然可以在 Linux 上运行,并且存在 sqlite odbc 驱动程序( http://www.ch-werner.de/sqliteodbc/ )我认为您无法通过 odbc 将您的 sqlite“注册”到数据源的中央列表中- 那是纯粹的窗户...

If it's only small numbers of people who access you db then you should be ok. However, SQlite sucks at large numbers of concurrent accesses - I switched over from sqlite to mysql when I had lots of concurrent access because the db kept getting locked.

For many concurrent accesses, you need something in between it that takes the brunt of the requests, like a (small) webserver or even a python program that can take all those requests and can regulate the access to the sqlite db. Use an ORM like SQLAlchemy or SQLObject that can access sqlite in a threadsafe way.

As for using odbc on linux to make sqlite accessible as a data source to the linux users, while ODBC certainly works on linux, and an sqlite odbc driver exists ( http://www.ch-werner.de/sqliteodbc/ ) I don't think you can 'register' your sqlite via odbc into a central list of data sources - that's pure windows...

御弟哥哥 2024-09-09 16:05:34

首先,这是 ODBC 的维基百科文章。它是用于与数据库交互的标准软件 API。但是,我怀疑如果你想使用 SQLite 和 SQLite,你是否需要使用它。一起Python。 Python 有一个名为 sqlite3 的内置模块,它应该可以帮助您。祝你好运。

First off, here's the wikipedia article for ODBC. It's a standard software API for interacting with a database. However, I doubt you need to use it if you want to use SQLite & Python together. Python has a built-in module called sqlite3 that should help you along the way. Good Luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文