MariaDB/MySQL 数据库上的 SQLDependency

SQLDependency on a MariaDB/MySQL database(MariaDB/MySQL 数据库上的 SQLDependency)
本文介绍了MariaDB/MySQL 数据库上的 SQLDependency的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个需要显示实时信息的 Web 仪表板 (ASP.NET C#).通常我使用 SQLServer,所以 SignalR + SQLDependency 的组合效果很好.但是现在我必须使用 MariaDB/MySQL 数据库,我找不到与 SQLDependency 等效的库.通知数据库更改是否有技巧"?

I developed a web dashboard that needs to display real-time information (ASP.NET C #). Usually I use SQLServer, so the combination SignalR + SQLDependency works very well. But now I have to use a MariaDB / MySQL database and I can not find a library equivalent to SQLDependency. Is there a "trick" for notifying a change in a database?

我找到了这个库:https://www.devart.com/dotconnect/mysql/docs/Devart.Data.MySql~Devart.Data.MySql.MySqlDependency.html 但它不是免费的......

I found this library : https://www.devart.com/dotconnect/mysql/docs/Devart.Data.MySql~Devart.Data.MySql.MySqlDependency.html but it's not free ...

推荐答案

在 MySQL 中,您可能会利用触发器和用户定义函数 (UDF).

In MySQL, you could potentially utilize a trigger and a user-defined function (UDF).

另一个选项是 MySqlDependency,但我认为这需要购买驱动程序:

Another option would be MySqlDependency, however I believe that would require a purchased driver:

https://dev.mysql.com/doc/refman/8.0/en/create-trigger.html

https://www.devart.com/dbx/mysql/

这篇关于MariaDB/MySQL 数据库上的 SQLDependency的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)