Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Apr 27, 2023
1 parent 9b9a75c commit 78c7fcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ type Connection
query_implementation self query alias known_table_names = case query of
_ : Text ->
result = self.query alias=alias <|
if self.tables.at 'Name' . to_vector . contains query then (SQL_Query.Table_Name query) else
if known_table_names.contains query then (SQL_Query.Table_Name query) else
SQL_Query.Raw_SQL query
result.catch SQL_Error sql_error->
case self.dialect.is_probably_a_query query of
Expand Down
3 changes: 2 additions & 1 deletion test/Table_Tests/src/Database/Postgres_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ postgres_specific_spec connection db_name setup =
tables.at "Schema" . to_vector . at 0 . should_equal "public"
tables.at "Name" . to_vector . at 0 . should_equal tinfo
tables.at "Type" . to_vector . at 0 . should_equal "TABLE"

connection.tables "TestT_ble%" . row_count . should_equal 1
connection.tables "Temporary%ble" . row_count . should_equal 1
connection.tables "Temporary%ble%" . row_count . should_equal 1
connection.tables "N_nexistent%" . row_count . should_equal 0

Test.specify "should be able to filter tables by type" <|
Expand Down

0 comments on commit 78c7fcf

Please sign in to comment.