Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for memory optimised tables #782

Closed
sjh37 opened this issue Dec 5, 2022 · 2 comments
Closed

Add support for memory optimised tables #782

sjh37 opened this issue Dec 5, 2022 · 2 comments
Assignees

Comments

@sjh37
Copy link
Owner

sjh37 commented Dec 5, 2022

The first step is ensuring you are on compatibility level >=130. Run this query to find out the current compatibility level:

SELECT compatibility_level FROM sys.databases WHERE name = DB_NAME();

Check if In-Memory OLTP is supported for this server edition and database pricing tier. This has to be 1.

SELECT CAST(SERVERPROPERTY(N'IsXTPSupported') AS BIT) AS IsXTPSupported

Next, list tables where this is switched on:

SELECT SCHEMA_NAME(schema_id) SchemaName, name TableName
FROM sys.tables
WHERE is_memory_optimized = 1;

For any memory-optimised tables

-- EF Core 6
modelBuilder
    .Entity<Blog>()
    .IsMemoryOptimized();

-- EF Core 7
modelBuilder
    .Entity<Blog>()
    .ToTable(b => b.IsMemoryOptimized());

More info microsoft and red-gate and github

@sjh37 sjh37 self-assigned this Dec 5, 2022
@sjh37
Copy link
Owner Author

sjh37 commented Dec 12, 2022

Completed

@sjh37 sjh37 closed this as completed Dec 12, 2022
@sjh37
Copy link
Owner Author

sjh37 commented Mar 2, 2023

Released in v3.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant