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 blank line after create_function in schema #170

Merged

Conversation

danielwestendorf
Copy link
Contributor

Before:

# FUNCTION: uuid7ToBeginningOfDay
  # SQL: CREATE FUNCTION uuid7ToBeginningOfDay AS input -> toUUID(concat(hex(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) - (reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) % 86400000)), \'00000000000000000000\'))
  create_function "uuid7ToBeginningOfDay", "input -> toUUID(concat(hex(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) - (reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) % 86400000)), \'00000000000000000000\'))", force: true
  # FUNCTION: uuid7ToDateTime
  # SQL: CREATE FUNCTION uuid7ToDateTime AS input -> fromUnixTimestamp64Milli(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))))
  create_function "uuid7ToDateTime", "input -> fromUnixTimestamp64Milli(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))))", force: true
  # FUNCTION: uuidToBeginningOfDayDateTime
  # SQL: CREATE FUNCTION uuidToBeginningOfDayDateTime AS input -> reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12))))
  create_function "uuidToBeginningOfDayDateTime", "input -> reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12))))", force: true

After:

# FUNCTION: fooBar
  # SQL: CREATE FUNCTION uuid7ToBeginningOfDay AS input -> toUUID(concat(hex(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) - (reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) % 86400000)), \'00000000000000000000\'))
  create_function "uuid7ToBeginningOfDay", "input -> toUUID(concat(hex(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) - (reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))) % 86400000)), \'00000000000000000000\'))", force: true

  # FUNCTION: uuid7ToDateTime
  # SQL: CREATE FUNCTION uuid7ToDateTime AS input -> fromUnixTimestamp64Milli(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))))
  create_function "uuid7ToDateTime", "input -> fromUnixTimestamp64Milli(reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12)))))", force: true

  # FUNCTION: uuidToBeginningOfDayDateTime
  # SQL: CREATE FUNCTION uuidToBeginningOfDayDateTime AS input -> reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12))))
  create_function "uuidToBeginningOfDayDateTime", "input -> reinterpretAsUInt64(reverse(unhex(substring(hex(input), 1, 12))))", force: true

@danielwestendorf danielwestendorf marked this pull request as draft October 14, 2024 20:43
@danielwestendorf danielwestendorf marked this pull request as ready for review October 14, 2024 21:59
@PNixx PNixx merged commit b76c783 into PNixx:master Oct 23, 2024
16 checks passed
dmitrytrager added a commit to mayak-bz/clickhouse-activerecord that referenced this pull request Jan 20, 2025
* new-master: (77 commits)
  Use a flag to track updates/deletes instead of guessing (PNixx#188)
  Do not squish table definitions in schema dump. (PNixx#187)
  Add support for integer limits in map type (PNixx#178)
  Improve function dumps (PNixx#179)
  Reliably sort functions, views, and materialized views in schema (PNixx#181)
  Maintain primary key type specificity (PNixx#183)
  Support create table with request settings
  Support codec column PNixx#135, refactoring
  Add Array support to Map (PNixx#158)
  SchemaDumper adds materialized view destination (PNixx#159)
  Improve DB::Exception error handling (PNixx#165)
  Add blank line after create_function in schema (PNixx#170)
  Include column definitions in schema dump if the column name is not `id` (PNixx#173)
  Add support for LIMIT BY clause (PNixx#169)
  Add support for force `CREATE FUNCTION` (PNixx#146)
  Implement GROUP BY GROUPING SETS with new `group_by_grouping_sets` query method. (PNixx#161)
  fix for function creation in structure.sql (PNixx#166)
  fix schema dumper
  fix spec
  fix detect model primary key for older clickhouse versions
  ...
dmitrytrager added a commit to mayak-bz/clickhouse-activerecord that referenced this pull request Jan 20, 2025
* new-master: (77 commits)
  Use a flag to track updates/deletes instead of guessing (PNixx#188)
  Do not squish table definitions in schema dump. (PNixx#187)
  Add support for integer limits in map type (PNixx#178)
  Improve function dumps (PNixx#179)
  Reliably sort functions, views, and materialized views in schema (PNixx#181)
  Maintain primary key type specificity (PNixx#183)
  Support create table with request settings
  Support codec column PNixx#135, refactoring
  Add Array support to Map (PNixx#158)
  SchemaDumper adds materialized view destination (PNixx#159)
  Improve DB::Exception error handling (PNixx#165)
  Add blank line after create_function in schema (PNixx#170)
  Include column definitions in schema dump if the column name is not `id` (PNixx#173)
  Add support for LIMIT BY clause (PNixx#169)
  Add support for force `CREATE FUNCTION` (PNixx#146)
  Implement GROUP BY GROUPING SETS with new `group_by_grouping_sets` query method. (PNixx#161)
  fix for function creation in structure.sql (PNixx#166)
  fix schema dumper
  fix spec
  fix detect model primary key for older clickhouse versions
  ...
dmitrytrager added a commit to mayak-bz/clickhouse-activerecord that referenced this pull request Jan 21, 2025
* new-master: (77 commits)
  Use a flag to track updates/deletes instead of guessing (PNixx#188)
  Do not squish table definitions in schema dump. (PNixx#187)
  Add support for integer limits in map type (PNixx#178)
  Improve function dumps (PNixx#179)
  Reliably sort functions, views, and materialized views in schema (PNixx#181)
  Maintain primary key type specificity (PNixx#183)
  Support create table with request settings
  Support codec column PNixx#135, refactoring
  Add Array support to Map (PNixx#158)
  SchemaDumper adds materialized view destination (PNixx#159)
  Improve DB::Exception error handling (PNixx#165)
  Add blank line after create_function in schema (PNixx#170)
  Include column definitions in schema dump if the column name is not `id` (PNixx#173)
  Add support for LIMIT BY clause (PNixx#169)
  Add support for force `CREATE FUNCTION` (PNixx#146)
  Implement GROUP BY GROUPING SETS with new `group_by_grouping_sets` query method. (PNixx#161)
  fix for function creation in structure.sql (PNixx#166)
  fix schema dumper
  fix spec
  fix detect model primary key for older clickhouse versions
  ...
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.

3 participants