Skip to content

Instantly share code, notes, and snippets.

@PaulDMendoza
PaulDMendoza / Postgres2C#Class
Last active March 1, 2024 13:46
Postgresql table to C# class converter
SELECT 'public ' ||
case
when data_type = 'uuid' THEN 'Guid'
when data_type = 'text' then 'string'
when data_type = 'json' then 'string'
when data_type = 'integer' then 'int'
when data_type = 'boolean' then 'bool'
when data_type = 'bigint' then 'long'
when data_type = 'timestamp with time zone' then 'DateTimeOffset'
when data_type = 'timestamp without time zone' then 'DateTime'