Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing data type keywords #724

Closed
wants to merge 1 commit into from
Closed

Add missing data type keywords #724

wants to merge 1 commit into from

Conversation

nomicode
Copy link
Contributor

While editing data-types.rst in the main CrateDB Reference, I noticed that the following data types do not get automatically uppercased by the console:

  • int2
  • int4
  • int8
  • name
  • oid
  • oidvector
  • regclass
  • regproc
  • timestamptz
  • timetz

This commit adds these data types to the list of keywords.

@nomicode nomicode requested a review from amotl June 11, 2021 15:11
nomicode added a commit to crate/crate that referenced this pull request Jun 11, 2021
Copy link
Member

@amotl amotl left a comment

Choose a reason for hiding this comment

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

Thank you @norosa!

@mfussenegger and @seut: There is no remote command to inquire the list of keywords from CrateDB itself yet, right?

@mfussenegger
Copy link
Member

There is no remote command to inquire the list of keywords from CrateDB itself yet, right?

select * from pg_get_keywords()

Not all data types are automatically keywords. In fact, most aren't.

Looks like the list of keywords in the admin-ui already contains a lot of things that are not keywords in CrateDB.

@amotl
Copy link
Member

amotl commented Jun 14, 2021

@mfussenegger: Thank you. We can discuss how this situation can be improved the next time we meet? Do you have any specific suggestions or is there already some guide or plan from the past?

@mfussenegger
Copy link
Member

In crash there was a change to load the keywords dynamically if the server side information is available: crate/crash@a01a352

In the admin interface we could do the same (and without version/availability checks, because the admin interface is version bound to specific CrateDB versions anyways)

@nomicode
Copy link
Contributor Author

nomicode commented Jun 14, 2021

@mfussenegger I noticed the same thing. as a rule, I capitalize reserved keywords per the SQL standard. however, I wasn't aware of the pg_get_keywords function. good to know

while working on crate/crate#11418, I was trying to determine what to capitalize. I had the Admin UI open and was performing experiments already, so I was quick to arrive at the conclusion that the examples in the docs should match the capitalization in the Admin UI console (even if they weren't reserved keywords, per my usual rule of thumb)

I was planning to do a follow-up PR for crash (thinking it was likely to work in a similar way to the Admin UI) but I see that that isn't possible (or desirable)

should we merge this PR as is and create a new issue for implementing pg_get_keywords functionality, or should we close it?

@amotl
Copy link
Member

amotl commented Jun 15, 2021

If this patch should go in in general, not taking further actions into account here, I would like to include it into the upcoming release.

@nomicode nomicode added the ready-to-merge Let Mergify merge the PR once approved and checks pass label Jun 16, 2021
nomicode added a commit to crate/crate that referenced this pull request Jun 17, 2021
@nomicode nomicode force-pushed the nomi/data-types branch 2 times, most recently from c9c64ec to 3863a52 Compare June 21, 2021 14:22
While editing [data-types.rst][1] in the main CrateDB Reference, I noticed that
the following data types do not get automatically uppercased by the console:

- `int2`
- `int4`
- `int8`
- `name`
- `oid`
- `oidvector`
- `regclass`
- `regproc`
- `timestamptz`
- `timetz`

This commit adds these data types to the list of keywords.

[1]: https://crate.io/docs/crate/reference/en/4.5/general/ddl/data-types.html
@amotl
Copy link
Member

amotl commented Jun 21, 2021

Hi again,

Mergify apparently doesn't do its job here. So, after integrating this, #729 will probably have to be adjusted. Do you agree, @norosa and @proddata?

With kind regards,
Andreas.

@amotl
Copy link
Member

amotl commented Jun 21, 2021

Is there a final verdict on whether this is appropriate to add or not? I just created #737 as a spinoff.

/cc @proddata, @mfussenegger, @seut

@mfussenegger
Copy link
Member

I think #737 is the way to go. As was already pointed out - most data types are actually not keywords.

@nomicode
Copy link
Contributor Author

ack

@nomicode nomicode closed this Jun 23, 2021
@nomicode nomicode deleted the nomi/data-types branch June 23, 2021 14:42
nomicode added a commit to crate/crate that referenced this pull request Jul 8, 2021
nomicode added a commit to crate/crate that referenced this pull request Jul 13, 2021
I have squashed all commits on this branch. I am going to tease apart the
changes into separate PRs:

- One or more PRs that cover the changes made to individual whole docs (other
  than `data-types.rst`, where most of changes are).

- Basic restructuring changes for `data-types.rst` so that the heading
  structure matches the final intended structure.

- One or more PRs for the remaining changes to `data-types.rst`, each intended
  to cover a specific logical set changes.

  Specifically, for example, a PR that covers my changes for the `TIMESTAMP`
  data type. Changes like this are big enough to warrant review in isolation.

I have chosen not to cherry-pick commits, because each doc has been visited
multiple time by commits that span multiple docs. It will make it easier for:
me to (as above):

- Chunk it by file (except `data-types.rst`).

- Prepare `data-types.rst` for the main changes by getting the document
  structure sorted in advance.

- Slot data types changes in one-by-one, without having to alter the structure
  of the `data-types.rst` doc.

For my reference, the rest of this commit message preserves the individual
commit messages from the squashed commits.

Eventually, this commit will be discarded, and any information in the commit
message that needs to be preserved will be migrated to the relevant PR.

---

some impromptu improvements (7494fe1)

more to follow

so far:

- started making some light improvements to the README

- ended up adding a lot of links to the main docs

- ended up tidying up the pages I linked to so that readers have a good
  first impression if they click through

- improved the intros for the three main SQL docs (syntax, compatibility,
  compliance) and improved how they link through to each other

- (unexpectedly) ended up spending most of my time reworking the data types
  docs (and some adjacent PostgreSQL compat info)

---

- Add `_venv/` to .gitignore (2d9978b)

- Restructuring (2d9978b)

- checkpoint (73670a6)

- Uppercase data types added to CrateDB Admin keywords list (f7050bf)

  See crate/crate-admin#724

- checkpoint (caa68f1)

- checkpoint (f7050bf)

- finish null type, fix http doc (f7050bf)

- clean up (f7050bf)

- labels (f7050bf)

- checkpoint (f7050bf)

- finished with dates and types (f7050bf)

- checkpoint (f7050bf)
nomicode added a commit to crate/crate that referenced this pull request Jul 13, 2021
I have squashed all commits on #11418. The
old PR and old branch will be left in place until this work is complete.

I am going to tease apart the changes into separate PRs:

- One or more PRs that cover the changes made to individual whole docs (other
  than `data-types.rst`, where most of changes are).

- Basic restructuring changes for `data-types.rst` so that the heading
  structure matches the final intended structure.

- One or more PRs for the remaining changes to `data-types.rst`, each intended
  to cover a specific logical set changes.

  Specifically, for example, a PR that covers my changes for the `TIMESTAMP`
  data type. Changes like this are big enough to warrant review in isolation.

I have chosen not to cherry-pick commits, because each doc has been visited
multiple time by commits that span multiple docs. It will make it easier for:
me to (as above):

- Chunk it by file (except `data-types.rst`).

- Prepare `data-types.rst` for the main changes by getting the document
  structure sorted in advance.

- Slot data types changes in one-by-one, without having to alter the structure
  of the `data-types.rst` doc.

For my reference, the rest of this commit message preserves the individual
commit messages from the squashed commits.

Eventually, this commit will be discarded, and any information in the commit
message that needs to be preserved will be migrated to the relevant PR.

---

some impromptu improvements (7494fe1)

more to follow

so far:

- started making some light improvements to the README

- ended up adding a lot of links to the main docs

- ended up tidying up the pages I linked to so that readers have a good
  first impression if they click through

- improved the intros for the three main SQL docs (syntax, compatibility,
  compliance) and improved how they link through to each other

- (unexpectedly) ended up spending most of my time reworking the data types
  docs (and some adjacent PostgreSQL compat info)

---

- Add `_venv/` to .gitignore (2d9978b)

- Restructuring (2d9978b)

- checkpoint (73670a6)

- Uppercase data types added to CrateDB Admin keywords list (f7050bf)

  See crate/crate-admin#724

- checkpoint (caa68f1)

- checkpoint (f7050bf)

- finish null type, fix http doc (f7050bf)

- clean up (f7050bf)

- labels (f7050bf)

- checkpoint (f7050bf)

- finished with dates and types (f7050bf)

- checkpoint (f7050bf)
nomicode added a commit to crate/crate that referenced this pull request Jul 13, 2021
I have squashed all commits on #11418. The
old PR and old branch will be left in place until this work is complete.

I am going to tease apart the changes into separate PRs:

- One or more PRs that cover the changes made to individual whole docs (other
  than `data-types.rst`, where most of changes are).

- Basic restructuring changes for `data-types.rst` so that the heading
  structure matches the final intended structure.

- One or more PRs for the remaining changes to `data-types.rst`, each intended
  to cover a specific logical set changes.

  Specifically, for example, a PR that covers my changes for the `TIMESTAMP`
  data type. Changes like this are big enough to warrant review in isolation.

I have chosen not to cherry-pick commits, because each doc has been visited
multiple time by commits that span multiple docs. It will make it easier for:
me to (as above):

- Chunk it by file (except `data-types.rst`).

- Prepare `data-types.rst` for the main changes by getting the document
  structure sorted in advance.

- Slot data types changes in one-by-one, without having to alter the structure
  of the `data-types.rst` doc.

For my reference, the rest of this commit message preserves the individual
commit messages from the squashed commits.

Eventually, this commit will be discarded, and any information in the commit
message that needs to be preserved will be migrated to the relevant PR.

---

some impromptu improvements (7494fe1)

more to follow

so far:

- started making some light improvements to the README

- ended up adding a lot of links to the main docs

- ended up tidying up the pages I linked to so that readers have a good
  first impression if they click through

- improved the intros for the three main SQL docs (syntax, compatibility,
  compliance) and improved how they link through to each other

- (unexpectedly) ended up spending most of my time reworking the data types
  docs (and some adjacent PostgreSQL compat info)

---

- Add `_venv/` to .gitignore (2d9978b)

- Restructuring (2d9978b)

- checkpoint (73670a6)

- Uppercase data types added to CrateDB Admin keywords list (f7050bf)

  See crate/crate-admin#724

- checkpoint (caa68f1)

- checkpoint (f7050bf)

- finish null type, fix http doc (f7050bf)

- clean up (f7050bf)

- labels (f7050bf)

- checkpoint (f7050bf)

- finished with dates and types (f7050bf)

- checkpoint (f7050bf)
nomicode added a commit to crate/crate that referenced this pull request Jul 15, 2021
I have squashed all commits on #11418. The
old PR and old branch will be left in place until this work is complete.

I am going to tease apart the changes into separate PRs:

- One or more PRs that cover the changes made to individual whole docs (other
  than `data-types.rst`, where most of changes are).

- Basic restructuring changes for `data-types.rst` so that the heading
  structure matches the final intended structure.

- One or more PRs for the remaining changes to `data-types.rst`, each intended
  to cover a specific logical set changes.

  Specifically, for example, a PR that covers my changes for the `TIMESTAMP`
  data type. Changes like this are big enough to warrant review in isolation.

I have chosen not to cherry-pick commits, because each doc has been visited
multiple time by commits that span multiple docs. It will make it easier for:
me to (as above):

- Chunk it by file (except `data-types.rst`).

- Prepare `data-types.rst` for the main changes by getting the document
  structure sorted in advance.

- Slot data types changes in one-by-one, without having to alter the structure
  of the `data-types.rst` doc.

For my reference, the rest of this commit message preserves the individual
commit messages from the squashed commits.

Eventually, this commit will be discarded, and any information in the commit
message that needs to be preserved will be migrated to the relevant PR.

---

some impromptu improvements (7494fe1)

more to follow

so far:

- started making some light improvements to the README

- ended up adding a lot of links to the main docs

- ended up tidying up the pages I linked to so that readers have a good
  first impression if they click through

- improved the intros for the three main SQL docs (syntax, compatibility,
  compliance) and improved how they link through to each other

- (unexpectedly) ended up spending most of my time reworking the data types
  docs (and some adjacent PostgreSQL compat info)

---

- Add `_venv/` to .gitignore (2d9978b)

- Restructuring (2d9978b)

- checkpoint (73670a6)

- Uppercase data types added to CrateDB Admin keywords list (f7050bf)

  See crate/crate-admin#724

- checkpoint (caa68f1)

- checkpoint (f7050bf)

- finish null type, fix http doc (f7050bf)

- clean up (f7050bf)

- labels (f7050bf)

- checkpoint (f7050bf)

- finished with dates and types (f7050bf)

- checkpoint (f7050bf)
amotl pushed a commit to crate/crate that referenced this pull request Aug 3, 2021
I have squashed all commits on #11418. The
old PR and old branch will be left in place until this work is complete.

I am going to tease apart the changes into separate PRs:

- One or more PRs that cover the changes made to individual whole docs (other
  than `data-types.rst`, where most of changes are).

- Basic restructuring changes for `data-types.rst` so that the heading
  structure matches the final intended structure.

- One or more PRs for the remaining changes to `data-types.rst`, each intended
  to cover a specific logical set changes.

  Specifically, for example, a PR that covers my changes for the `TIMESTAMP`
  data type. Changes like this are big enough to warrant review in isolation.

I have chosen not to cherry-pick commits, because each doc has been visited
multiple time by commits that span multiple docs. It will make it easier for:
me to (as above):

- Chunk it by file (except `data-types.rst`).

- Prepare `data-types.rst` for the main changes by getting the document
  structure sorted in advance.

- Slot data types changes in one-by-one, without having to alter the structure
  of the `data-types.rst` doc.

For my reference, the rest of this commit message preserves the individual
commit messages from the squashed commits.

Eventually, this commit will be discarded, and any information in the commit
message that needs to be preserved will be migrated to the relevant PR.

---

some impromptu improvements (7494fe1)

more to follow

so far:

- started making some light improvements to the README

- ended up adding a lot of links to the main docs

- ended up tidying up the pages I linked to so that readers have a good
  first impression if they click through

- improved the intros for the three main SQL docs (syntax, compatibility,
  compliance) and improved how they link through to each other

- (unexpectedly) ended up spending most of my time reworking the data types
  docs (and some adjacent PostgreSQL compat info)

---

- Add `_venv/` to .gitignore (2d9978b)

- Restructuring (2d9978b)

- checkpoint (73670a6)

- Uppercase data types added to CrateDB Admin keywords list (f7050bf)

  See crate/crate-admin#724

- checkpoint (caa68f1)

- checkpoint (f7050bf)

- finish null type, fix http doc (f7050bf)

- clean up (f7050bf)

- labels (f7050bf)

- checkpoint (f7050bf)

- finished with dates and types (f7050bf)

- checkpoint (f7050bf)
amotl pushed a commit to crate/crate that referenced this pull request Aug 3, 2021
I have squashed all commits on #11418. The
old PR and old branch will be left in place until this work is complete.

I am going to tease apart the changes into separate PRs:

- One or more PRs that cover the changes made to individual whole docs (other
  than `data-types.rst`, where most of changes are).

- Basic restructuring changes for `data-types.rst` so that the heading
  structure matches the final intended structure.

- One or more PRs for the remaining changes to `data-types.rst`, each intended
  to cover a specific logical set changes.

  Specifically, for example, a PR that covers my changes for the `TIMESTAMP`
  data type. Changes like this are big enough to warrant review in isolation.

I have chosen not to cherry-pick commits, because each doc has been visited
multiple time by commits that span multiple docs. It will make it easier for:
me to (as above):

- Chunk it by file (except `data-types.rst`).

- Prepare `data-types.rst` for the main changes by getting the document
  structure sorted in advance.

- Slot data types changes in one-by-one, without having to alter the structure
  of the `data-types.rst` doc.

For my reference, the rest of this commit message preserves the individual
commit messages from the squashed commits.

Eventually, this commit will be discarded, and any information in the commit
message that needs to be preserved will be migrated to the relevant PR.

---

some impromptu improvements (7494fe1)

more to follow

so far:

- started making some light improvements to the README

- ended up adding a lot of links to the main docs

- ended up tidying up the pages I linked to so that readers have a good
  first impression if they click through

- improved the intros for the three main SQL docs (syntax, compatibility,
  compliance) and improved how they link through to each other

- (unexpectedly) ended up spending most of my time reworking the data types
  docs (and some adjacent PostgreSQL compat info)

---

- Add `_venv/` to .gitignore (2d9978b)

- Restructuring (2d9978b)

- checkpoint (73670a6)

- Uppercase data types added to CrateDB Admin keywords list (f7050bf)

  See crate/crate-admin#724

- checkpoint (caa68f1)

- checkpoint (f7050bf)

- finish null type, fix http doc (f7050bf)

- clean up (f7050bf)

- labels (f7050bf)

- checkpoint (f7050bf)

- finished with dates and types (f7050bf)

- checkpoint (f7050bf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Let Mergify merge the PR once approved and checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants