-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds the spec for all update actions, but implements the common input validation framework and `Insert`. Tests for remaining actions are marked as pending - these will be implemented in a subsequent PR.
- Loading branch information
Showing
23 changed files
with
725 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Column_Constraint.enso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from Standard.Base import all | ||
|
||
## ADVANCED | ||
Specifies additional properties for a column created using | ||
`Connection.create_table`. | ||
|
||
The support for the constraints may vary between databases. | ||
type Column_Constraint | ||
## ADVANCED | ||
Specifies a default value for the column. | ||
|
||
Argument: | ||
- `sql_expression`: The SQL expression to use as the default value. Note that this is a raw SQL expression, so if you want to set a default to a string, you must include the quotes. The quoting style may depend on the database. Never pass unsanitized data to this parameter. | ||
|
||
! SQL Injection | ||
|
||
Since `sql_expression` is a raw SQL expression, note that malicious | ||
data can cause execution of arbitrary SQL queries. Only use this | ||
parameter with trusted data. | ||
Default_Expression (sql_expression : Text) | ||
|
||
## PRIVATE | ||
DEPRECATED This will be replaced by extending the `Value_Type` with the concept of non-nullable types. TODO in #5872 | ||
|
||
Specifies that the column does not accept `NULL` values. | ||
Not_Null |
16 changes: 16 additions & 0 deletions
16
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Column_Description.enso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from Standard.Base import all | ||
|
||
import Standard.Table.Data.Type.Value_Type.Value_Type | ||
|
||
import project.Data.Column_Constraint.Column_Constraint | ||
|
||
## Describes a column structure for `Connection.create_table`. | ||
type Column_Description | ||
|
||
## Describes a column structure for `Connection.create_table`. | ||
|
||
Arguments: | ||
- name: The name of the column. | ||
- value_type: The type of the column. | ||
- constraints: Additional SQL constraints for the column. | ||
Value (name:Text) (value_type:Value_Type) (constraints : Vector Column_Constraint = []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
distribution/lib/Standard/Database/0.0.0-dev/src/Extensions/Upload_Default_Helpers.enso
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
distribution/lib/Standard/Database/0.0.0-dev/src/Internal/IR/Create_Column_Descriptor.enso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from Standard.Base import all | ||
|
||
import project.Data.Column_Constraint.Column_Constraint | ||
|
||
## PRIVATE | ||
type Create_Column_Descriptor | ||
## PRIVATE | ||
A description of a column for the `Create_Table` query. | ||
Value (name : Text) (sql_type : Text) (constraints : Vector Column_Constraint) |
Oops, something went wrong.