PNixx / clickhouse-activerecord

A Ruby database ActiveRecord driver for ClickHouse
MIT License
202 stars 100 forks source link

Add blank line after create_function in schema #170

Closed danielwestendorf closed 1 month ago

danielwestendorf commented 1 month ago

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