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

QueryRewrite: add support for FromSql #15704

Closed
maumar opened this issue May 14, 2019 · 4 comments
Closed

QueryRewrite: add support for FromSql #15704

maumar opened this issue May 14, 2019 · 4 comments
Assignees
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@maumar
Copy link
Contributor

maumar commented May 14, 2019

Issue for tracking purposes - when FromSql works, make sure to enable skipped tests.

@maumar maumar added this to the 3.0.0 milestone May 14, 2019
@roji
Copy link
Member

roji commented May 16, 2019

Note from discussion: in the old pipeline it was possible have FromSql() anywhere in the query - ordering was ignored (e.g. a predicate specified before the FromSql() was rendered after it in the SQL query). We have decided to disallow this and make the following changes:

  • Change FromSqlRaw() and FromSqlInterpolated() to be extension methods on DbSet instead of on IQueryable
  • Leave the obsolete FromSql() on IQueryable so that users have a chance to see the obsoletion message. However, a runtime check will still throw if FromSql() is specified on a non-DbSet.

@roji
Copy link
Member

roji commented May 18, 2019

Note: splitting out parameter support to #15750 as discussed with @smitpatel

roji added a commit to roji/efcore that referenced this issue May 18, 2019
* Parameterization not implemented (see dotnet#15750)
* FromSqlRaw() and FromSqlInterpolated() are now defined over DbSet<>,
  not IQueryable<>. FromSql() is still defined over IQueryable<> but
  throws if not directly on a DbSet<>.

Closes dotnet#15704
roji added a commit to roji/efcore that referenced this issue May 23, 2019
* Parameterization not implemented (see dotnet#15750)
* FromSqlRaw() and FromSqlInterpolated() are now defined over DbSet<>,
  not IQueryable<>. FromSql() is still defined over IQueryable<> but
  throws if not directly on a DbSet<>.

Closes dotnet#15704
roji added a commit to roji/efcore that referenced this issue May 23, 2019
* Parameterization not implemented (see dotnet#15750)
* FromSqlRaw() and FromSqlInterpolated() are now defined over DbSet<>,
  not IQueryable<>. FromSql() is still defined over IQueryable<> but
  throws if not directly on a DbSet<>.

Closes dotnet#15704
roji added a commit to roji/efcore that referenced this issue May 27, 2019
* Parameterization not implemented (see dotnet#15750)
* FromSqlRaw() and FromSqlInterpolated() are now defined over DbSet<>,
  not IQueryable<>. FromSql() is still defined over IQueryable<> but
  throws if not directly on a DbSet<>.

Closes dotnet#15704
roji added a commit to roji/efcore that referenced this issue May 27, 2019
* Parameterization not implemented (see dotnet#15750)
* FromSqlRaw() and FromSqlInterpolated() are now defined over DbSet<>,
  not IQueryable<>. FromSql() is still defined over IQueryable<> but
  throws if not directly on a DbSet<>.

Closes dotnet#15704
roji added a commit that referenced this issue May 27, 2019
* Parameterization not implemented (see #15750)
* FromSqlRaw() and FromSqlInterpolated() are now defined over DbSet<>,
  not IQueryable<>. FromSql() is still defined over IQueryable<> but
  throws if not directly on a DbSet<>.

Closes #15704
@divega
Copy link
Contributor

divega commented May 31, 2019

@roji reopening so that we can remember to document the additional breaking changes for preview 6.

@divega divega reopened this May 31, 2019
@roji
Copy link
Member

roji commented May 31, 2019

Oops, forgot about that - will submit a doc PR soon.

@roji roji closed this as completed Jun 9, 2019
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 2, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview7 Jul 2, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview7, 3.0.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

4 participants