Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

add url datatype #29

Merged
merged 3 commits into from
Apr 6, 2019
Merged

add url datatype #29

merged 3 commits into from
Apr 6, 2019

Conversation

csinrn
Copy link
Collaborator

@csinrn csinrn commented Apr 5, 2019

No description provided.

Copy link
Member

@tigercosmos tigercosmos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Almost there.

fn is_value_valid(value: &str, datatype: &DataType) -> bool {
match datatype {
DataType::Url => {
let re = Regex::new(r"^(http|https)?://[\w\-\.]+(:\d+)?(/[~\w/\.]*)?(\?\S*)?(#\S*)?").unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

127.0.0.1 似乎不會過?
url 前面的 scheme 不止 https 和 http,其實可以是任何東西,而且也不一定要加,我是覺得就不用檢查

src/sql/lexer.rs Outdated

loop {
match chars.next() {
Some(x) => {
if is_identifier_char(x) || is_operator(x) {
if (x == '"') || is_quoted {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他有可能是 '"

lexer.rs 下面的 test 補一下
不然看不出有沒有 bug

@tigercosmos tigercosmos merged commit fd258cc into stellarsql:master Apr 6, 2019
@tigercosmos tigercosmos mentioned this pull request May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants