简体   繁体   English

是否有任何支持计算列的内存数据库?

[英]Are there any in-memory databases that support computed columns?

We have a SQL 2005/2008 database that has a table with a computed column. 我们有一个SQL 2005/2008数据库,该数据库具有带计算列的表。 We're using the computed column as a discriminator in NHibernate so having it in the database is proving to be very useful. 我们在NHibernate中将计算列用作区分符,因此事实证明将其存入数据库非常有用。

In order to gain the benefits of faster integration tests, I'd like to be able to run our integration tests against an in-memory database such as SQLite or SQL CE. 为了获得更快的集成测试的好处,我希望能够针对内存数据库(例如SQLite或SQL CE)运行集成测试。 But I don't think either of those support the computed column. 但是我不认为这两个都支持计算列。

Are there any other solutions to my problem? 我的问题还有其他解决办法吗? I have complete access to the database and can modify it if there's a better solution available. 我拥有对数据库的完全访问权限,并且如果有更好的解决方案,可以对其进行修改。 I've seen this post that suggests using a view instead of a computed column, is this the best alternative? 我看过这篇文章建议使用视图而不是计算列,这是最好的选择吗?

What I did was added the computed column to the DataTable when loading the table from SqlCe. 从SqlCe加载表时,我所做的就是将计算列添加到DataTable中。 I stored the definition of the computed DataColumn in a "configuration" table stored in the database. 我将计算出的DataColumn的定义存储在数据库中存储的“配置”表中。 I was able to do complex calculations that depended on a "chain" of tables, where each table performed a simplier function of a more complex function. 我能够进行依赖于表“链”的复杂计算,其中每个表执行的是复杂函数的简单函数。 (The last table in the chain contained the results.) I used SqlCe because one table of five contained 15 million rows. (链中的最后一个表包含结果。)我使用SqlCe,因为五个表中的一个包含1500万行。 Too much data for the in-memory data sets of ADO.NET. ADO.NET的内存中数据集的数据过多。 (I had a requirement of using local client based calculations before posting to server.) (我要求在发布到服务器之前使用基于本地客户端的计算。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM