question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding is_filtered_index for SQL Server dialect

See original GitHub issue

I noticed that SQLAlchemy does not reflect the filter definition of SQL Server indexes. I see how this makes sense since you expect the filter definition to be a SQLAlchemy construct instead of a SQL string.

https://docs.sqlalchemy.org/en/13/dialects/mssql.html#filtered-indexes

However, it is not possible to determine if a unique index implies uniqueness in a subset of the table or the entire table without this information. Would be possible to add an is_filtered_index dialect-specific kwarg for MSSQL Server or something along these lines? I would be happy to implement it and submit a PR.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
zzzeekcommented, Aug 8, 2020

hey there.

Can we just augment the first query at the top of def get_indexes() with the extra columns? that way we can just use the query we already have.

0reactions
sqla-testercommented, Aug 20, 2020

RamonWill has proposed a fix for this issue in the master branch:

Add support for SQL Server filtered indexes https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/2142

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create filtered indexes - SQL Server - Microsoft Learn
A filtered index is an optimized disk-based rowstore nonclustered index especially suited to cover queries that select from a well-defined ...
Read more >
how to configure hibernate config file for sql server
Change the Dialect used by Hibernate to talk to the database. There are two drivers to connect to SQL Server; the open source...
Read more >
Introduction to SQL Server Filtered Indexes - SQLShack
A SQL Server filtered index is a non-clustered index that allows us to apply specific conditions to cover a subset of rows in...
Read more >
Configuring Spring Boot for Microsoft SQL Server
On the SQL Server Services node, right-click SQL Server (SQLEXPRESS), and select Restart. This sets up SQL Server to be reached from JDBC...
Read more >
Microsoft SQL Server - SQLAlchemy 1.4 Documentation
An INSERT statement which attempts to provide a value for a column that is marked with IDENTITY will be rejected by SQL Server....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found