Module: ActiveRecord::ConnectionAdapters::Duckdb::DatabaseLimits

Included in:
ActiveRecord::ConnectionAdapters::DuckdbAdapter
Defined in:
lib/active_record/connection_adapters/duckdb/database_limits.rb

Instance Method Summary collapse

Instance Method Details

#index_name_lengthInteger

Returns the maximum length for index names

Returns:

  • (Integer)

    The maximum index name length (delegates to max_identifier_length)



32
33
34
# File 'lib/active_record/connection_adapters/duckdb/database_limits.rb', line 32

def index_name_length
  max_identifier_length
end

#max_identifier_lengthInteger

Since DuckDb is PostgreSQL compatible (64-1), we can use the same limits as PostgreSQL. In the future want to drop possible PostgreSQL compatibility we can change the limits to match whatever limits DuckDB may want to impose www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS Returns the maximum length for database identifiers

Returns:

  • (Integer)

    The maximum identifier length (63 characters for PostgreSQL compatibility)



14
15
16
# File 'lib/active_record/connection_adapters/duckdb/database_limits.rb', line 14

def max_identifier_length
  63
end

#table_alias_lengthInteger

Returns the maximum length for table aliases

Returns:

  • (Integer)

    The maximum table alias length (delegates to max_identifier_length)



20
21
22
# File 'lib/active_record/connection_adapters/duckdb/database_limits.rb', line 20

def table_alias_length
  max_identifier_length
end

#table_name_lengthInteger

Returns the maximum length for table names

Returns:

  • (Integer)

    The maximum table name length (delegates to max_identifier_length)



26
27
28
# File 'lib/active_record/connection_adapters/duckdb/database_limits.rb', line 26

def table_name_length
  max_identifier_length
end