C#mySQL库是否等于SQL SQLBulkCopy类?
我知道有mysqlbulkloader,但是它不是等效的,因为它无法从内存发送数据并需要文件。
这对我来说是一个大问题,因为我想从已经在做很多I/O。
的程序中将大量数据插入MySQL数据库中 我也无力将数百万行写入文件中,然后让mysqlbulkloader再次读回它们,当我已经将它们放在内存中时,这是没有意义的。
为什么没有一个选项可以直接从内存进行操作,而不是在磁盘上使用文件?
I know there is MySqlBulkLoader, however it's not an equivalent as it isn't able to send data from memory and requires a file.
This is a big problem for me because I want to bulk insert a huge amount of data into a MySQL database from a program that is already doing a lot of I/O.
I can't afford to also write millions of rows into a file and then have the MySqlBulkLoader read them back again, when I already have them in memory, it makes no sense.
Why isn't there an option to do it directly from memory instead of using a file on disk?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑您使用Oracle的连接器/网。该图书馆有几个问题,主要围绕异步/等待和实体框架支持,但其中之一是大量负载支持。 MySQL允许从标准控制台进行大量加载。
而不是Oracle的驱动程序使用 mysqlConnector package。该软件包由最受欢迎的EF提供商
MySqlConnector allows bulk imports through its MySqlBulkCopy class which works similarly to SqlBulkCopy and
MySQLConnector的核心API与连接器/NET相同。有一个迁移指南也解释了差异。本指南包括MySQLConnector中固定的连接器/网络错误
I suspect you use Oracle's Connector/NET. That library has several issues, mainly around async/await and Entity Framework support but one of them is the limited bulk load support. MySQL allows bulk loading from the standard console.
Instead of Oracle's driver use the MySqlConnector package. That package is used by the most popular EF provider, Pomelo.EntityFrameworkCore.MySql with 22M downloads compared to Oracle's 900K downloads. MySqlConnector by itself has 35M downloads compared to Oracle's 38M.
MySqlConnector allows bulk imports through its MySqlBulkCopy class which works similarly to SqlBulkCopy and accepts both DataTable and DataReader inputs.
MySqlConnector's core API is the same as Connector/NET. There's a migration guide as well that explains the differences. This guide includes the Connector/NET bugs that are fixed in MySqlConnector