AmrDeveloper / GQL

Git Query language is a SQL like language to perform queries on .git files with supports of most of SQL features such as grouping, ordering and aggregations functions
https://amrdeveloper.github.io/GQL/
MIT License
3.19k stars 88 forks source link

Implement SQL String functions with documentations #13

Closed AmrDeveloper closed 3 months ago

AmrDeveloper commented 1 year ago

Implement string function in our engine, one per pull request.

Steps:

Text Functions

For more information about implementation and description check https://www.w3schools.com/sql/sql_ref_sqlserver.asp

Note: You can only open max 3 PR at the time

Lilit0x commented 1 year ago

I am on ASCII

Lilit0x commented 1 year ago

I am on CHAR

Lilit0x commented 1 year ago

@AmrDeveloper , the CHARINDEX function might be tricky since the last argument is optional, but the condition checks if the specified arguments match, I mean here .

Lilit0x commented 1 year ago

I am on DATALENGTH. Also, you made a typo for DATALENGTH in the list

AmrDeveloper commented 1 year ago

@AmrDeveloper , the CHARINDEX function might be tricky since the last argument is optional, but the condition checks if the specified arguments match, I mean here .

You are right some functions we will delay them until do some improvements in type system

Lilit0x commented 1 year ago

I am on LEFT

Lilit0x commented 1 year ago

@AmrDeveloper, is there a difference between the implementation of NCHAR and CHAR at least in Rust, since all characters are just u32s under the hood and just casting from the number will be the same.

AmrDeveloper commented 1 year ago

NCHAR

You are right, we can ignore it for now and maybe if needed we can pass the the char function to it

Lilit0x commented 1 year ago

NCHAR

You are right, we can ignore it for now and maybe if needed we can pass the the char function to it

Yeahh, that was I planned on doing, wanted to get your approval on it.

Lilit0x commented 1 year ago

I am on PATINDEX

AmrDeveloper commented 1 year ago

NCHAR

You are right, we can ignore it for now and maybe if needed we can pass the the char function to it

Yeahh, that was I planned on doing, wanted to get your approval on it.

I faced the same problem in Date functions too we need to decide if we should duplicate them or take only one

Lilit0x commented 1 year ago

NCHAR

You are right, we can ignore it for now and maybe if needed we can pass the the char function to it

Yeahh, that was I planned on doing, wanted to get your approval on it.

I faced the same problem in Date functions too we need to decide if we should duplicate them or take only one

We could just use different names for them but they'll still be the same function. What I mean is:

  map.insert("char", text_char);
  map.insert("nchar", text_char);

And we do the same in the PROTOTYPES hashmap too

Lilit0x commented 1 year ago

I am on REPLACE

Lilit0x commented 1 year ago

I am on RIGHT

Lilit0x commented 1 year ago

I am on STUFF

Lilit0x commented 1 year ago

I am on SUBSTRING

Lilit0x commented 1 year ago

I am on TRANSLATE

AmrDeveloper commented 1 year ago

@Lilit0x Lets keep next PR one by one it will be fast to review and merge

Lilit0x commented 1 year ago

Okay, got it.

Lilit0x commented 1 year ago

I am on SOUNDEX

tbro commented 1 year ago

I am on CONCAT

tbro commented 1 year ago

I am on UNICODE

mobley-trent commented 9 months ago

I am on CHARINDEX

mobley-trent commented 9 months ago

Hello @AmrDeveloper how do we handle optional arguments ?

AmrDeveloper commented 9 months ago

@mobley-trent Optional type is not implemented yet, i just implemented Variant and will implement Option soon

AmrDeveloper commented 9 months ago

@mobley-trent Now support Optional and varargs types

frectonz commented 6 months ago

@AmrDeveloper NCHAR is already implemented but it's not marked as complete in the task list.

2024-02-26T04:57:57,788529872+03:00

frectonz commented 6 months ago

I am on QUOTENAME