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 copy hook utils module #29

Closed
wants to merge 1 commit into from
Closed

Conversation

aykut-bozkurt
Copy link
Collaborator

No description provided.

}

pub(crate) fn validate_copy_from_options(pstmt: &PgBox<pg_sys::PlannedStmt>) {
let allowed_options = ["format"];
Copy link
Collaborator

@marcoslot marcoslot Oct 2, 2024

Choose a reason for hiding this comment

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

do we want to allow freeze? (and propagate that into copy logic)


let mut found_parquet_format = false;
let mut copy_options = unsafe { PgList::<DefElem>::from_pg(copy_stmt.options) };
for option in copy_options.iter_ptr() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it wasn't quite clear to me why we're looking for the format here

this function seems to do more than its name suggests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made it copy_from_stmt_add_or_update_binary_format_option

Copy link
Collaborator

Choose a reason for hiding this comment

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

still a bit confusing to me, we probably want to build a new options list for internal use containing options like: format 'binary' (always), freeze (if present in the original list)

}
}

pub(crate) fn copy_relation_oid(pstmt: &PgBox<pg_sys::PlannedStmt>) -> Oid {
Copy link
Collaborator

Choose a reason for hiding this comment

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

copy looks more like a verb here

maybe copy_statement_relation_oid, copy_statement_lock_mode

@aykut-bozkurt
Copy link
Collaborator Author

Addressed at development branch.

@aykut-bozkurt aykut-bozkurt deleted the copy-hook-utils branch October 17, 2024 13:01
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