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

Adds CREATE SEQUENCE and DROP SEQUENCE #219

Merged
merged 1 commit into from
May 15, 2024
Merged

Conversation

Hydrocharged
Copy link
Collaborator

@Hydrocharged Hydrocharged commented May 2, 2024

Companion PR:

This adds functionality for CREATE SEQUENCE and DROP SEQUENCE. For sequences, this is what is in the PR:

  • MINVALUE
  • MAXVALUE
  • INCREMENT
  • AS DATA TYPE
  • START WITH
  • CYCLE

This is what is missing:

  • TEMPORARY
  • UNLOGGED
  • CACHE
  • OWNED BY
  • SERIAL
  • Merging
  • Table Querying

Of what's missing, merging and SERIAL are the main additions, with OWNED BY required for proper SERIAL support. Table querying is fairly straightforward (the pg_sequences system table, etc.). The others are, hopefully, unnecessary for now and can be postponed, although perhaps we can save the CACHE value and ignore it since it's primarily a performance-oriented option.

With that, SERIAL and merging will come in the next PR, since this is already very large. Also of note, the Writer and Reader utilities were implemented for my Convert-to-Cast PR but they were useful here, so I pulled them from that in-flight PR and added them here.

@Hydrocharged Hydrocharged requested a review from zachmu May 2, 2024 13:30
@Hydrocharged Hydrocharged marked this pull request as ready for review May 13, 2024 12:30
@Hydrocharged Hydrocharged changed the title Sequences Draft Adds CREATE SEQUENCE and DROP SEQUENCE May 13, 2024
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

Mostly looks good.

Main comment is to use flatbuffers for serialization, don't roll your own.

core/procedures/create_sequence.go Show resolved Hide resolved
core/rootvalue.go Outdated Show resolved Hide resolved
core/sequences/sequence.go Show resolved Hide resolved
core/sequences/sequence.go Outdated Show resolved Hide resolved
core/sequences/sequence.go Show resolved Hide resolved
flatbuffers/serial/rootvalue.fbs Show resolved Hide resolved
core/rootvalue.go Show resolved Hide resolved
server/ast/create_sequence.go Show resolved Hide resolved
server/functions/setval.go Outdated Show resolved Hide resolved
utils/reader.go Show resolved Hide resolved
@Hydrocharged Hydrocharged merged commit 85082c1 into main May 15, 2024
8 checks passed
@Hydrocharged Hydrocharged deleted the daylon/sequences branch May 15, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants