Search Shortcut cmd + k | ctrl + k
inflector

Powerful string case transformation and inflection capabilities directly to your SQL queries.

Maintainer(s): rustyconover

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.4.4 1.4.5 1.5.5 1.5.6 2.0.0
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL inflector FROM community;
LOAD inflector;

About inflector

For more information regarding usage, see the documentation.

Added Functions

function_name function_type description comment examples
inflect scalar Transforms a string value using the specified case format NULL [inflect('snake', 'helloWorld')]
inflect scalar Transforms struct field names using the specified case format NULL [inflect('snake', {firstName: 'John', lastName: 'Doe'})]
inflect scalar NULL NULL  
inflect table Transforms column names in query results using the specified case format NULL [FROM inflect('snake', SELECT firstName, lastName FROM users)]
inflector_deconstantize scalar Removes the rightmost segment from a constant expression NULL [inflector_deconstantize('Net::HTTP')]
inflector_demodulize scalar Removes the module part from a fully qualified name NULL [inflector_demodulize('ActiveRecord::CoreExtensions::String')]
inflector_deordinalize scalar Removes the ordinal suffix from a string (1st -> 1) NULL [inflector_deordinalize('1st')]
inflector_is_camel_case scalar Returns true if the string is in camelCase format NULL [inflector_is_camel_case('helloWorld')]
inflector_is_class_case scalar Returns true if the string is in ClassCase (PascalCase) format NULL [inflector_is_class_case('HelloWorld')]
inflector_is_foreign_key scalar Returns true if the string is in foreign key format (ends with _id) NULL [inflector_is_foreign_key('message_id')]
inflector_is_kebab_case scalar Returns true if the string is in kebab-case format NULL [inflector_is_kebab_case('hello-world')]
inflector_is_pascal_case scalar Returns true if the string is in PascalCase format NULL [inflector_is_pascal_case('HelloWorld')]
inflector_is_screamingsnake_case scalar Returns true if the string is in SCREAMING_SNAKE_CASE format NULL [inflector_is_screamingsnake_case('HELLO_WORLD')]
inflector_is_sentence_case scalar Returns true if the string is in Sentence case format NULL [inflector_is_sentence_case('Hello world')]
inflector_is_snake_case scalar Returns true if the string is in snake_case format NULL [inflector_is_snake_case('hello_world')]
inflector_is_table_case scalar Returns true if the string is in table_case format (snake_case plural) NULL [inflector_is_table_case('foo_bars')]
inflector_is_title_case scalar Returns true if the string is in Title Case format NULL [inflector_is_title_case('Hello World')]
inflector_is_train_case scalar Returns true if the string is in Train-Case format NULL [inflector_is_train_case('Hello-World')]
inflector_ordinalize scalar Converts a number string to its ordinal form (1st, 2nd, 3rd, etc.) NULL [inflector_ordinalize('1')]
inflector_to_camel_case scalar Converts a string to camelCase format NULL [inflector_to_camel_case('hello_world')]
inflector_to_class_case scalar Converts a string to ClassCase (PascalCase) format NULL [inflector_to_class_case('hello_world')]
inflector_to_foreign_key scalar Converts a class name to a foreign key column name NULL [inflector_to_foreign_key('Message')]
inflector_to_kebab_case scalar Converts a string to kebab-case format NULL [inflector_to_kebab_case('helloWorld')]
inflector_to_pascal_case scalar Converts a string to PascalCase format NULL [inflector_to_pascal_case('hello_world')]
inflector_to_plural scalar Returns the plural form of a word NULL [inflector_to_plural('person')]
inflector_to_screamingsnake_case scalar Converts a string to SCREAMING_SNAKE_CASE format NULL [inflector_to_screamingsnake_case('helloWorld')]
inflector_to_sentence_case scalar Converts a string to Sentence case format NULL [inflector_to_sentence_case('helloWorld')]
inflector_to_singular scalar Returns the singular form of a word NULL [inflector_to_singular('people')]
inflector_to_snake_case scalar Converts a string to snake_case format NULL [inflector_to_snake_case('helloWorld')]
inflector_to_table_case scalar Converts a string to table_cases format (snake_case plural) NULL [inflector_to_table_case('FooBar')]
inflector_to_title_case scalar Converts a string to Title Case format NULL [inflector_to_title_case('hello_world')]
inflector_to_train_case scalar Converts a string to Train-Case format NULL [inflector_to_train_case('helloWorld')]

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

name description input_type scope aliases
inflector_acronyms List of acronyms preserved as uppercase in case conversions (e.g., HTML, API) VARCHAR[] GLOBAL []