-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
GLUE_INDEXES
reserved table which provides all index info (#…
…935) e.g. SELECT * FROM GLUE_INDEXES; `GLUE_INDEXES` table provides all the index information from the entire database. It includes both clustered index (primary key) and non-clustered index. Table contains five columns: - TABLE_NAME - INDEX_NAME - ORDER - EXPRESSION - UNIQUENESS
- Loading branch information
Showing
6 changed files
with
98 additions
and
9 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
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,30 @@ | ||
use {crate::*, gluesql_core::prelude::Value::*}; | ||
|
||
test_case!(ditionary_index, async move { | ||
run!("CREATE TABLE Foo (id INT, name TEXT);"); | ||
run!("CREATE INDEX Foo_id ON Foo (id)"); | ||
run!("CREATE INDEX Foo_id_2 ON Foo (id + 2)"); | ||
test!( | ||
"SELECT * FROM GLUE_INDEXES", | ||
Ok(select!( | ||
TABLE_NAME | INDEX_NAME | ORDER | EXPRESSION | UNIQUENESS; | ||
Str | Str | Str | Str | Bool; | ||
"Foo".to_owned() "Foo_id".to_owned() "BOTH".to_owned() "id".to_owned() false; | ||
"Foo".to_owned() "Foo_id_2".to_owned() "BOTH".to_owned() "id + 2".to_owned() false | ||
)) | ||
); | ||
|
||
run!("CREATE TABLE Bar (id INT PRIMARY KEY, name TEXT);"); | ||
run!("CREATE INDEX Bar_name_concat ON Bar (name + '_')"); | ||
test!( | ||
"SELECT * FROM GLUE_INDEXES", | ||
Ok(select!( | ||
TABLE_NAME | INDEX_NAME | ORDER | EXPRESSION | UNIQUENESS; | ||
Str | Str | Str | Str | Bool; | ||
"Bar".to_owned() "PRIMARY".to_owned() "BOTH".to_owned() "id".to_owned() true; | ||
"Bar".to_owned() "Bar_name_concat".to_owned() "BOTH".to_owned() "name + \"_\"".to_owned() false; | ||
"Foo".to_owned() "Foo_id".to_owned() "BOTH".to_owned() "id".to_owned() false; | ||
"Foo".to_owned() "Foo_id_2".to_owned() "BOTH".to_owned() "id + 2".to_owned() false | ||
)) | ||
); | ||
}); |
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