-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Documentations for Cast and TypesTable
- Loading branch information
1 parent
a50408b
commit 47fe801
Showing
5 changed files
with
52 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### Cast expression | ||
|
||
In GitQL there are two types of casting, Explicit and Implicit casting | ||
|
||
#### Implicit Casting | ||
|
||
Implicit casting is performed without the need from you to write cast operator or function for example | ||
|
||
```sql | ||
SELECT True = 't' | ||
``` | ||
|
||
In this case the engine perform implicit cast from Text 't' to become boolean 'true' so it's end up with | ||
|
||
```sql | ||
SELECT True = True | ||
``` | ||
|
||
The same is performed when you write Date, Time or DateTime as String and pass it to function that accept Date. | ||
|
||
#### Explicit Casting | ||
|
||
Implicit casting can handle some cases when the value is const and has specific pattern, but in some cases you want for example | ||
to cast Float to Int or Int to Float after the value is evaluated or provided from real data, in this case you need to explicit ask the engine | ||
to case this value to another type, for example | ||
|
||
```SQL | ||
SELECT CAST(commits_count AS Real); | ||
``` |
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