- Notifications
You must be signed in to change notification settings - Fork 0
experiment addition of schema support#1
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
base:paket-and-new-dotnetsdk-for-main-solution
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
7d8f59d94ebc3ab0820d0ce783208b7d3909f1ef28File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,6 +4,11 @@ open System.Collections.Generic | ||
| open Rezoom.SQL.Compiler.InferredTypes | ||
| type private ModelChange(model : Model, inference : ITypeInferenceContext) = | ||
| member private this.CreateSchema(create: InfCreateSchemaStmt) = | ||
| stateful { | ||
| let schema = { SchemaName = create.SchemaName; Objects = Map.empty } | ||
| return! ComplexModelOps.createSchema schema create | ||
| } |> State.runForOutputState model |> Some | ||
| member private this.CreateTable(create : InfCreateTableStmt) = | ||
| stateful { | ||
| let! tableName = ComplexModelOps.qualifyTemp create.Temporary create.Name | ||
| @@ -64,6 +69,8 @@ type private ModelChange(model : Model, inference : ITypeInferenceContext) = | ||
| return! ModelOps.dropView objName | ||
| | DropTable -> | ||
| return! ModelOps.dropTable objName | ||
| | DropSchema -> | ||
| return! ModelOps.dropSchema { Value = Some drop.ObjectName.ObjectName; Source = objName.Source } | ||
OwnerAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rspeele: Note that it is | ||
| } |> State.runForOutputState model |> Some | ||
| member this.CreateIndex(create : InfCreateIndexStmt) = | ||
| stateful { | ||
| @@ -75,6 +82,7 @@ type private ModelChange(model : Model, inference : ITypeInferenceContext) = | ||
| member this.Stmt(stmt : InfStmt) = | ||
| match stmt with | ||
| | AlterTableStmt alter -> this.AlterTable(alter) | ||
| | CreateSchemaStmt create -> this.CreateSchema(create) | ||
| | CreateTableStmt create -> this.CreateTable(create) | ||
| | CreateViewStmt create -> this.CreateView(create) | ||
| | CreateIndexStmt create -> this.CreateIndex(create) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rspeele: This is simplest thing that seems to work.
I'm prepending any object resolution here, which may have an impact (no test failing though), should I only do that when the
name.SchemaNameis empty? or should it be handled another way?