895 questions
0
votes
0
answers
38
views
Failed to connect to the database error: invalid page in block 22 of relation base/12971/2674
I am trying to run in-memory Postgres using pgmock, the connection is getting established but getting this error while running any query.
Failed to connect to the database error: invalid page in ...
0
votes
0
answers
57
views
Unexpected TaskCanceledException in xUnit test that runs SQL Server Express LocalDB health check
I have an ASP.NET Core 8.0 REST API with a collection of xUnit unit, integration, and functional tests.
The REST API has some health checks registered with the IServiceProvider at application startup:
...
0
votes
0
answers
63
views
In-Memory database seems to be persisting data
I have this NUnit test:
using System.Data.SQLite;
[Test]
public async Task InMemoryTest()
{
using var connection = new SQLiteConnection(
"Data Source=file:abc?...
0
votes
0
answers
55
views
How can I find where SQLite stores data when using an in-memory database (:memory:)?
The memory consumption of a Node.js server process using an SQLite in-memory database decreased from 1.5 GB to 50 MB in Task Manager, while the SQLite database still contains 1 GB of data. The ...
0
votes
0
answers
106
views
Haystack inmemorydocumentstore can store only 10 documents
everyone i have been using haystack inmemorydocumentstore with overwrite policy. I wanted to store for 5k documents as vector db using inmemorydocumentstore of haystack.
But i came to know that it ...
0
votes
1
answer
194
views
Using SQLite in-memory with EF Core - context.Database.EnsureCreated keeps throwing 'AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY'
I am currently trying to write unit tests for a project in C# that relies heavily on Entity Framework Core. In order to do that I have decided to use a SQLite in-memory database, and taking ...
0
votes
0
answers
20
views
Redis containers suddenly closed
I am setting up a redis cluster with 6 containers(Redis 7.2.5). After scanning with the scan command along with various test cases, I delete the keys I obtained. I'm using RedisPlusPlus. But suddenly ...
1
vote
0
answers
45
views
Entity Framework Core in memory reading wrong data type
My functional tests use Microsoft.EntityFrameworkCore.InMemory version 7.0.20.
When I run the functional tests for any entity that has a dateonly field, I get an error:
Expression of type 'System....
0
votes
1
answer
54
views
How to test using InMemoryDatabase if DbSet is set as required
My DbSet is required. I'd like to create test using InMemoryDatabase. However when I instantiate context I'm getting an error
Error (active) CS9035
Required member 'TestContext.Users' must be set in ...
0
votes
0
answers
74
views
Mocking IDbContextFactory with NSubstitute, disposes context
I am using IDbContextFactory in a Blazor server application. I want to mock the services. I can do this using Moq, but when switching to NSubstitute, I run into a problem: only the Save method in the ...
0
votes
0
answers
177
views
OneTimeSetUp: System.ArgumentNullException : Value cannot be null. (Parameter 'connectionString') -In Memory Database
I'm trying to set up an automated testing framework using NUnit and after I decided that going through the extreme pain of attempting to use Moq and specifically to set up some of the Moq behaviour ...
0
votes
0
answers
18
views
Placing datasource configuration class used for both local dev and unit testing in src/main/java or src/test/java
My application uses springboot with springdatajpa and is connected to two dbs(microsoft sql and mysql). For local developement and unit testing I am using same datasource classes for connecting to two ...
0
votes
0
answers
167
views
How to use Sqlite in .NET Framework 4.8 unit test project?
I want to use an in-memory Sqlite database in my unit test project. My database is a dbml and I already parse it to a SQL script and create a Sqlite database from it. My database file was created ...
1
vote
1
answer
101
views
How to load an SQLite Binary data dump into an in-memory read-only database instance?
I have an SQLite binary dump of around 10mb. The dumped database contains some catalogue data, which I need to be able to read from really fast from a Ruby application (sub-millisecond). Therefore I ...
0
votes
1
answer
74
views
Embedded key value store cache
Are there any embedded alternatives to Memcached? Specifically, I'm looking for an open-source solution that can be used as an in-memory key-value storage within my application. I'm not concerned ...
0
votes
0
answers
26
views
Is it possible to append the data in Redis command
I have 6 workload files like workloads, workloadb, workload etc.
I am using the below command to load the data.
./bin/ycsb.sh load Redis -s - P workloads/workloada -p recordcount=400000 -threads 100 ...
0
votes
1
answer
328
views
Showing Console of hsqldb as H2, Spring Boot 3
I'm trying to use hsqldb like in-memory database.
In my build.gradle file, you can see the version:
implementation group: 'org.hsqldb', name: 'hsqldb', version: '2.7.2'
In my application.yml file, I ...
0
votes
1
answer
692
views
C# EF - How to unit test a SQLite file in memory?
In my unit tests, I'm currently making a temp copy of an SQLite file, running the method I'm testing, and then deleting the file.
The issue I'm running into with this, is when I have multiple unit ...
1
vote
0
answers
121
views
Best Practices for Handling Failures and Ensuring Data Consistency Across In-Memory DB, MongoDB, and Kafka in a Processing Pipeline
I'm architecting a service with a processing pipeline that updates an in-memory database, persists those updates in MongoDB, and finally produces messages to Kafka. My challenge is ensuring seamless ...
0
votes
1
answer
66
views
Autofac Dependency Injection for Azure Table and EntityFrameworkCore InMemoryDb
I have built a service class that communicates with both an Azure Table Storage Table, and an EntityFrameworkCore InMemory Database.
public sealed class NotificationService : INotificationService
{
...
0
votes
0
answers
225
views
NpgsqlTsVector doesn't work using EF In Memory Database
I have a NpgsqlTsVector attribute in my C# class:
public NpgsqlTsVector Pesquisa { get; set; }
I'm using it for searching in the database. It works using the real database.
The problem is in my test ...
0
votes
1
answer
54
views
ApplicationDbContext instance is creating again and again
I am working on a project with micro services.
Project 1: CustomerService (which provides API for editing customers)
Project 2: CoreService (which provides basic settings for .NET Core micro ...
2
votes
1
answer
204
views
Can't seed data in mocked InMemory db in Integration tests
I have next test class with one integration test that calls simple api endpoint.
Here in Setup method I'm replacing real db to InMemory and trying to add info about two cities to db.
public class ...
2
votes
1
answer
30
views
In-memory data store in the Ballerina: implementation, limitations, and scaling
I recently came across the in-memory datastore support of bal persist feature. Regarding this, could you provide the following details?
What is the underlying implementation of this?
How well does it ...
0
votes
2
answers
443
views
About refreshDatabase trait in laravel unit testing
I've my migrations at two different default location (database/migrations/tables/) and (database/migrations/foreign/) and i want to use the RefreshDatabase trait, however it uses the default ...
0
votes
0
answers
181
views
Attach in-memory sqlite database to physical database connection in c#
I have a physical sqlite database on disk and a named in-memory database that I need to run joint queries against. Reading the documentation, it's not quite clear if this is possible or how to ...
1
vote
1
answer
618
views
Postgres in memory for CI/CD purposes in node runtime
I'm looking for a solution to be able to spin up postgres-like solution that runs just in memory to be able to run full e2e tests in a pipeline. I know there are ways to spin up a temp database and ...
0
votes
1
answer
40
views
Entity Framework : referencing other objects
I have a Movie class that has lists of Actors and Directors.
Whenever I'm creating a Movie (using a Rest API) that uses those, everything's fine.
But when I'm creating a second one with an already ...
0
votes
1
answer
169
views
Can I rewrite this query to LINQ?
I have such query
SELECT DISTINCT ON (c.""CmsId"") ""CmsId"", c.""Id"", c.""Title""
FROM ""Content"&...
0
votes
0
answers
209
views
Why doesn't Laravel in-memory testing work when seeding is enabled?
I recently upgraded an application to Laravel 9, and have in-memory testing set up for the unit and feature tests.
<env name="DB_CONNECTION" value="inmemory"/>
<env name=&...
0
votes
0
answers
283
views
EF Setup database type of In-Memory database
Is it possible to setup type of in-memory database by Entity Framework? I need this In-Memory database correctly to be as Oracle SQL.
var options = new DbContextOptionsBuilder<MyDbContext>()....
1
vote
1
answer
1k
views
ExecuteDeleteAsync throws error on inmemory db [duplicate]
I was implementing the latest ef core 7 features ExecuteDeleteAsync(). Since that my test is failing. But is working on a real MsSql Server. I'm using an inmemory db and I am not sure if this is not ...
0
votes
0
answers
258
views
In Memory OLTP Database becomes suspect on SQL Server restart, can't restore
I have a SQL Server 2022 Enterprise Edition database called PCRData. It has 300 million rows spread across 260 tables. Each of the 260 tables are memory optimized tables and they collectively hold in ...
2
votes
1
answer
944
views
How to view SQL genarated by the Entity Framework Core with in-memory provider?
I want to view SQL generated by Linq in EF Core, but when the database is in-memory, there are no string SQL data.
I use Npgsql.EntityFrameworkCore.PostgreSQL (7.0.4), Microsoft.EntityFrameworkCore (...
2
votes
1
answer
125
views
ets can find the record but can't delete it
i have a simple problem. ets:lookup() can find the record but ets:delete() gives badarg error.
case ets:lookup(Connections, Next) of
[] ->
case ets:lookup(Connections, Prev) of
...
0
votes
1
answer
78
views
EF Core GetAll entries does not include referenced objects for all entries
I have a problem with EF where when I get all entries which has a list of associated activities.
Then it is only the last Entry which references the particular activity, which has the activity in its ...
0
votes
1
answer
157
views
Get Row count from results of a select statement in powershell
I am using the following code to create a small in memory database that reads its source from a CSV file. When I query with a select statement the number of rows always returns zero even though I KNOW ...
0
votes
1
answer
31
views
Nested Object cannot retain after posting when use InMemory database
I have 2 classes where one is nested in another like this
public class Account {
public int id {get; set;}
public string Name {get; set;}
public AccountEntry Entry {get; set;}
}
public ...
0
votes
2
answers
74
views
Error : 'The instance of entity type 'Produtos' cannot be tracked
Hello I'm trying to add a list of products to my order but I'm getting the exception in my C# code: System.InvalidOperationException: 'The instance of entity type 'Products' cannot be tracked because ...
0
votes
1
answer
34
views
Reaching the Catch Block with an in-memory approach
I have a TestController class where I'm performing unit tests on a Controller class.
The Controller class creates an instance of a Service class named _service. The Controller class has a method with ...
1
vote
0
answers
89
views
In-Memory Unit Tests
I'm attempting to do in-memory testing. I'm following this article.
The article provides this template for setting up an in-memory test.
My problem is occurring with the following section of the code ...
1
vote
1
answer
332
views
in-memory DB not supporting DefaultValue mapping in unit testing
Please advise how to set default value mapping for a property while writing in-memory unit test.
Database: SqlServer
Repository method -
public async Task<long> CreatePerson(CreatePersonRequest ...
0
votes
0
answers
182
views
InMemoryDirectoryServer allows to have to 2 users with the same username. How to fix it?
For testing purposes I started to use in-memory ldap server
val config = InMemoryDirectoryServerConfig(baseDn)
config.addAdditionalBindCredentials("cn=$LOGIN", PASSWORD)
config.schema = null
...
0
votes
1
answer
348
views
How to use DBT transformations in-memory?
I want to implement DBT transformation models in Azure Functions without any persistent storage.
By default however DBT will work with a running database instance like PostgreSQL. How can DBT be used ...
2
votes
1
answer
62
views
How to save and load in-memory dbplyr database to disk?
One can create an in-memory database with the dplyr package:
library(dplyr)
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
copy_to(con, mtcars)
Is there a way to save this DB to a ...
1
vote
0
answers
58
views
LINQ Query Only Returning Last Entity In In-Memory Database
I am working on a method that returns a list of entities in our database. We are using Entity Framework Core v6.0.13.
In the unit tests, we've locally seeded the entities as such:
private ...
1
vote
1
answer
146
views
Unit Test for a Query Handler with InMemoryDatabase and Generic Repository Pattern
I have a Generic Repository Pattern that receive the domain as Generic Type and I am creating a Unit Test for my Query Handler and using InMemoryDatabase.
The code below it's a reference for this post ...
0
votes
2
answers
119
views
Work with Concurrency Tokens shadow column with InMemory database in .NET
I'm trying to create unit tests for the database repository class using the InMemory Sqlite database. I have one of the entities with the Concurrency Tokens column named xmin.
This column configured ...
1
vote
0
answers
203
views
Problem with deploying IN-MEMORY db table changes with existing SCHEMABINDING dependencies
We have many automated deploys of in-memory and regular databases. Build produces dacpac, then SqlPackage.exe performs deploy. Recently we've faced an issue when tried to add new column to the table ...
0
votes
1
answer
1k
views
Hibernate save entity with existing Id
I am creating a CRUD application using Servlets and Hibernate.
When I try to save a new entity using save(), then Hibernate executes the SQL Update query and not Insert. The entity already contains ...