-
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.
Refine single-column Table to act as a Column (#12165)
- Closes #12137
- Loading branch information
Showing
30 changed files
with
494 additions
and
186 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
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
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
15 changes: 15 additions & 0 deletions
15
...n/lib/Standard/Database/0.0.0-dev/src/Internal/Type_Refinements/DB_Table_Refinements.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,15 @@ | ||
private | ||
|
||
from Standard.Base import all | ||
|
||
import project.DB_Column.DB_Column | ||
import project.DB_Table.DB_Table | ||
from project.Internal.Type_Refinements.Single_Column_DB_Table_Conversions import all | ||
|
||
refine_table (table : DB_Table) = | ||
if is_single_column table . not then table else | ||
r = table : DB_Table & DB_Column | ||
r | ||
|
||
is_single_column table:DB_Table -> Boolean = | ||
table.column_count == 1 |
12 changes: 12 additions & 0 deletions
12
.../Database/0.0.0-dev/src/Internal/Type_Refinements/Single_Column_DB_Table_Conversions.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,12 @@ | ||
private | ||
|
||
from Standard.Base import all | ||
|
||
import project.DB_Column.DB_Column | ||
import project.DB_Table.DB_Table | ||
from project.Internal.Type_Refinements.DB_Table_Refinements import is_single_column | ||
|
||
## This conversion is internal and should never be exported. | ||
DB_Column.from (that : DB_Table) -> DB_Column = | ||
Runtime.assert (is_single_column that) | ||
that.at 0 |
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
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
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
Oops, something went wrong.