Skip to content

Commit fd135a1

Browse files
authored
SQL Server Schema support and fix for Generic JDBC (#14032)
- Fix issue with `Database.connect` and Generic JDBC. - Move `make_table_for_name` and `make_table_from_query` to `SQL_Query` allowing expansion. - Add `schema` to `SQL_IR_From_Part.Table`. - Add alternative authentication to SQL Server. - Fix schema and table listing in SQL Server.
1 parent 8cbbcce commit fd135a1

File tree

38 files changed

+329
-152
lines changed

38 files changed

+329
-152
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
- [Implement `Text_Column` for in-memory backend.][13769]
2626
- [Implement `Text_Column.to_case` for in-memory backend.][13769]
2727
- [Add support for gzip encoded return from web APIs][14026]
28+
- [Fixes for JDBC connection and schema support for SQL Server.][14039]
2829

2930
[13769]: https://github.com/enso-org/enso/pull/13769
3031
[14026]: https://github.com/enso-org/enso/pull/14026
32+
[14039]: https://github.com/enso-org/enso/pull/14039
3133

3234
#### Enso Language & Runtime
3335

distribution/lib/Standard/AWS/0.0.0-dev/docs/api/Database/Redshift/Internal/Redshift_Dialect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- check_aggregate_support self aggregate:Standard.Base.Any.Any -> Standard.Base.Any.Any
99
- default_table_types self -> Standard.Base.Any.Any
1010
- ensure_query_has_no_holes self jdbc:Standard.Database.Internal.JDBC_Connection.JDBC_Connection raw_sql:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
11-
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
11+
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any schema_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
1212
- flagged self flag:Standard.Database.Dialects.Dialect_Flag.Dialect_Flag -> Standard.Base.Data.Boolean.Boolean
1313
- generate_collate self collation_name:Standard.Base.Data.Text.Text -> Standard.Base.Data.Text.Text
1414
- generate_expression self base_gen:Standard.Base.Any.Any expr:(Standard.Database.Internal.IR.SQL_IR_Expression.SQL_IR_Expression|Standard.Database.Internal.IR.Order_Descriptor.Order_Descriptor|Standard.Database.Internal.IR.SQL_IR_Statement.SQL_IR_Statement) for_select:Standard.Base.Data.Boolean.Boolean -> Standard.Database.SQL.SQL_Builder

distribution/lib/Standard/AWS/0.0.0-dev/src/Database/Redshift/Internal/Redshift_Dialect.enso

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@ type Redshift_Dialect
301301
---
302302
The dialect-dependent strategy to get the Primary Key for a given table.
303303
Returns `Nothing` if the key is not defined.
304-
fetch_primary_key : Connection -> Text -> Vector Text ! Nothing
305-
fetch_primary_key self connection table_name =
306-
Dialect.default_fetch_primary_key connection table_name
304+
fetch_primary_key : Connection -> Text -> Text -> Vector Text ! Nothing
305+
fetch_primary_key self connection table_name schema_name =
306+
Dialect.default_fetch_primary_key connection table_name schema_name
307307

308308
## ---
309309
private: true

distribution/lib/Standard/Database/0.0.0-dev/docs/api/Connection/Connection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
- internal_allocate_dry_run_table self table_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
1919
- maybe_run_maintenance self -> Standard.Base.Any.Any
2020
- new jdbc_connection:Standard.Database.Internal.JDBC_Connection.JDBC_Connection dialect:Standard.Base.Any.Any entity_naming_properties:Standard.Database.Internal.Connection.Entity_Naming_Properties.Entity_Naming_Properties data_link_setup:(Standard.Database.Internal.Data_Link_Setup.Data_Link_Setup|Standard.Base.Nothing.Nothing)= try_large_update:Standard.Base.Data.Boolean.Boolean= -> Standard.Database.Connection.Connection.Connection
21-
- query self query:Standard.Database.SQL_Query.SQL_Query alias:Standard.Base.Any.Any= -> Standard.Base.Any.Any
22-
- read self query:Standard.Database.SQL_Query.SQL_Query limit:Standard.Table.Rows_To_Read.Rows_To_Read= -> Standard.Base.Any.Any
21+
- query self query:Standard.Base.Any.Any alias:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
22+
- read self query:Standard.Base.Any.Any limit:Standard.Table.Rows_To_Read.Rows_To_Read= -> Standard.Base.Any.Any
2323
- read_statement self statement:Standard.Base.Any.Any column_types:Standard.Base.Any.Any= last_row_only:Standard.Base.Any.Any= -> Standard.Base.Any.Any
2424
- read_text_column self query:Standard.Base.Any.Any column_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
2525
- save_as_data_link self destination:Standard.Base.Any.Any on_existing_file:Standard.Base.System.File.Existing_File_Behavior.Existing_File_Behavior= -> Standard.Base.Any.Any

distribution/lib/Standard/Database/0.0.0-dev/docs/api/Dialects/Dialect.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- custom_build_aggregate self base_table:Standard.Database.DB_Table.DB_Table key_columns:(Standard.Base.Data.Vector.Vector Standard.Database.Internal.IR.Internal_Column.Internal_Column) resolved_aggregates:(Standard.Base.Data.Vector.Vector Standard.Base.Any.Any) problem_builder:Standard.Table.Internal.Problem_Builder.Problem_Builder -> (Standard.Base.Data.Pair.Pair Standard.Database.Internal.IR.SQL_IR_Source.SQL_IR_Source Standard.Base.Any.Any)
77
- default_table_types self -> Standard.Base.Any.Any
88
- ensure_query_has_no_holes jdbc:Standard.Database.Internal.JDBC_Connection.JDBC_Connection raw_sql:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
9-
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
9+
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any schema_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
1010
- flagged self flag:Standard.Database.Dialects.Dialect_Flag.Dialect_Flag -> Standard.Base.Data.Boolean.Boolean
1111
- generate_collate self collation_name:Standard.Base.Data.Text.Text -> Standard.Base.Data.Text.Text
1212
- generate_expression self base_gen:Standard.Base.Any.Any expr:(Standard.Database.Internal.IR.SQL_IR_Expression.SQL_IR_Expression|Standard.Database.Internal.IR.Order_Descriptor.Order_Descriptor|Standard.Database.Internal.IR.SQL_IR_Statement.SQL_IR_Statement) for_select:Standard.Base.Data.Boolean.Boolean -> Standard.Database.SQL.SQL_Builder
@@ -33,6 +33,6 @@
3333
- type Temp_Table_Style
3434
- Hash_Prefix
3535
- Temporary_Table
36-
- default_fetch_primary_key connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
36+
- default_fetch_primary_key connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any schema_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
3737
- postgres -> Standard.Base.Any.Any
3838
- sqlite -> Standard.Base.Any.Any

distribution/lib/Standard/Database/0.0.0-dev/docs/api/Internal/IR/SQL_IR_From_Part.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- Literal_Values column_vectors:(Standard.Base.Data.Vector.Vector Standard.Base.Any.Any) column_names:(Standard.Base.Data.Vector.Vector Standard.Base.Data.Text.Text) alias:Standard.Base.Data.Text.Text
66
- Query raw_sql:(Standard.Base.Data.Text.Text|Standard.Database.SQL.SQL_Statement) alias:Standard.Base.Data.Text.Text
77
- Sub_Query columns:(Standard.Base.Data.Vector.Vector Standard.Base.Any.Any) context:Standard.Database.Internal.IR.SQL_IR_Source.SQL_IR_Source alias:Standard.Base.Data.Text.Text
8-
- Table table_name:Standard.Base.Data.Text.Text alias:Standard.Base.Data.Text.Text internal_temporary_keep_alive_reference:Standard.Base.Any.Any=
8+
- Table table_name:Standard.Base.Data.Text.Text schema:Standard.Base.Data.Text.Text alias:Standard.Base.Data.Text.Text internal_temporary_keep_alive_reference:Standard.Base.Any.Any=
99
- Union queries:(Standard.Base.Data.Vector.Vector Standard.Database.Internal.IR.SQL_IR_Statement.SQL_IR_Statement) alias:Standard.Base.Data.Text.Text
1010
- traverse self f:Standard.Base.Any.Any -> Standard.Database.Internal.IR.SQL_IR_From_Part.SQL_IR_From_Part
1111
- type SQL_IR_From_Part_Comparator

distribution/lib/Standard/Database/0.0.0-dev/docs/api/Internal/IR/SQL_IR_Source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- as_subquery self alias:Standard.Base.Any.Any column_lists:Standard.Base.Any.Any -> Standard.Base.Any.Any
99
- for_query raw_sql:(Standard.Base.Data.Text.Text|Standard.Database.SQL.SQL_Statement) alias:Standard.Base.Data.Text.Text -> Standard.Database.Internal.IR.SQL_IR_Source.SQL_IR_Source
1010
- for_subquery subquery:Standard.Database.Internal.IR.SQL_IR_From_Part.SQL_IR_From_Part -> Standard.Database.Internal.IR.SQL_IR_Source.SQL_IR_Source
11-
- for_table table_name:Standard.Base.Data.Text.Text alias:Standard.Base.Data.Text.Text= internal_temporary_keep_alive_reference:Standard.Base.Any.Any= -> Standard.Base.Any.Any
11+
- for_table table_name:Standard.Base.Data.Text.Text schema:Standard.Base.Data.Text.Text alias:Standard.Base.Data.Text.Text= internal_temporary_keep_alive_reference:Standard.Base.Any.Any= -> Standard.Base.Any.Any
1212
- set_groups self new_groups:Standard.Base.Any.Any -> Standard.Base.Any.Any
1313
- set_limit self new_limit:Standard.Base.Any.Any -> Standard.Base.Any.Any
1414
- set_orders self new_orders:Standard.Base.Any.Any -> Standard.Base.Any.Any

distribution/lib/Standard/Database/0.0.0-dev/docs/api/Internal/Postgres/Postgres_Dialect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- check_aggregate_support self aggregate:Standard.Base.Any.Any -> Standard.Base.Any.Any
99
- default_table_types self -> Standard.Base.Any.Any
1010
- ensure_query_has_no_holes self jdbc:Standard.Database.Internal.JDBC_Connection.JDBC_Connection raw_sql:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
11-
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
11+
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any schema_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
1212
- flagged self flag:Standard.Database.Dialects.Dialect_Flag.Dialect_Flag -> Standard.Base.Data.Boolean.Boolean
1313
- generate_collate self collation_name:Standard.Base.Data.Text.Text -> Standard.Base.Data.Text.Text
1414
- generate_expression self base_gen:Standard.Base.Any.Any expr:(Standard.Database.Internal.IR.SQL_IR_Expression.SQL_IR_Expression|Standard.Database.Internal.IR.Order_Descriptor.Order_Descriptor|Standard.Database.Internal.IR.SQL_IR_Statement.SQL_IR_Statement) for_select:Standard.Base.Data.Boolean.Boolean -> Standard.Database.SQL.SQL_Builder

distribution/lib/Standard/Database/0.0.0-dev/docs/api/Internal/SQLite/SQLite_Dialect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- custom_build_aggregate self -> Standard.Base.Any.Any
1010
- default_table_types self -> Standard.Base.Any.Any
1111
- ensure_query_has_no_holes self jdbc:Standard.Database.Internal.JDBC_Connection.JDBC_Connection raw_sql:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
12-
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
12+
- fetch_primary_key self connection:Standard.Base.Any.Any table_name:Standard.Base.Any.Any schema_name:Standard.Base.Any.Any -> Standard.Base.Any.Any
1313
- flagged self flag:Standard.Database.Dialects.Dialect_Flag.Dialect_Flag -> Standard.Base.Data.Boolean.Boolean
1414
- generate_collate self collation_name:Standard.Base.Data.Text.Text -> Standard.Base.Data.Text.Text
1515
- generate_expression self base_gen:Standard.Base.Any.Any expr:(Standard.Database.Internal.IR.SQL_IR_Expression.SQL_IR_Expression|Standard.Database.Internal.IR.Order_Descriptor.Order_Descriptor|Standard.Database.Internal.IR.SQL_IR_Statement.SQL_IR_Statement) for_select:Standard.Base.Data.Boolean.Boolean -> Standard.Database.SQL.SQL_Builder

distribution/lib/Standard/Database/0.0.0-dev/docs/api/SQL_Query.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
- type SQL_Query
44
- Raw_SQL sql:Standard.Base.Data.Text.Text=
55
- Table_Name name:Standard.Base.Data.Text.Text=
6+
- to_db_table self connection:Standard.Database.Connection.Connection.Connection alias:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
7+
- make_table_for_name connection:Standard.Base.Any.Any name:Standard.Base.Any.Any schema:Standard.Base.Any.Any alias:Standard.Base.Any.Any internal_temporary_keep_alive_reference:Standard.Base.Any.Any= -> Standard.Base.Any.Any
8+
- make_table_from_query connection:Standard.Base.Any.Any query:(Standard.Base.Data.Text.Text|Standard.Database.SQL.SQL_Statement) alias:Standard.Base.Data.Text.Text -> (Standard.Table.Table.Table&Standard.Database.DB_Table.DB_Table)
69
- Standard.Database.SQL_Query.SQL_Query.from that:Standard.Base.Data.Text.Text -> Standard.Database.SQL_Query.SQL_Query

0 commit comments

Comments
 (0)