Skip to main content

Documentation for the postgresql-schema Generator

METADATA

PropertyValueNotes
generator namepostgresql-schemapass this to the generate command after -g
generator stabilityBETA
generator typeSCHEMA
generator languagePostgresql
generator default templating enginemustache
helpTxtGenerates a PostgreSQL schema based on the schema defined in the OpenAPI specification (v2, v3)

CONFIG OPTIONS

These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to configuration docs for more details.

OptionDescriptionValuesDefault
defaultDatabaseNameDatabase name that will be used for all generated PostgreSQL DDL and DML statements.
idAutoIncEnabledIf true, generates autoincrement PostgreSQL types SERIAL and BIGSERIAL for int32 and int64 respectively for integer fields with name 'id'.false
identifierNamingConventionNaming convention of PostgreSQL idebntifiers (table names and column names).
snake_case
Transform named to 'snake_case'.
original
Leave original names as in YAML file.
snake_case
jsonDataTypeUse of PostgreSQL data types for complex model properties.
json
Generate JSON fields. Value is stored in JSON data type field as human-readable text. Value compliance with JSON standard is checked.
jsonb
Generate JSONB fields. Value is stored in JSONB data type field in binary format. JSONB data type is generally nore efficient than JSON but it is not human-readable. Value compliance with JSON standard is checked.
off
Generate TEXT fields. Just store the value as plain text. Value compliance with JSON standard is not checked.
json
namedParametersEnabledGenerates query examples with named variables in value placeholders (eg.:name,:quantity) if true. Otherwise, generates question marks ? in value placeholders.false

IMPORT MAPPING

Type/AliasImports

INSTANTIATION TYPES

Type/AliasInstantiated By

LANGUAGE PRIMITIVES

  • BigDecimal
  • ByteArray
  • Date
  • DateTime
  • URI
  • UUID
  • bool
  • boolean
  • byte
  • char
  • date
  • double
  • file
  • float
  • int
  • integer
  • long
  • mixed
  • number
  • short
  • string
  • void

RESERVED WORDS

  • a
  • abort
  • abs
  • absent
  • absolute
  • access
  • according
  • acos
  • action
  • ada
  • add
  • admin
  • after
  • aggregate
  • all
  • allocate
  • also
  • alter
  • always
  • analyse
  • analyze
  • and
  • any
  • any_value
  • are
  • array
  • array_agg
  • array_max_cardinality
  • as
  • asc
  • asensitive
  • asin
  • assertion
  • assignment
  • asymmetric
  • at
  • atan
  • atomic
  • attach
  • attribute
  • attributes
  • authorization
  • avg
  • backward
  • base64
  • before
  • begin
  • begin_frame
  • begin_partition
  • bernoulli
  • between
  • bigint
  • binary
  • bit
  • bit_length
  • blob
  • blocked
  • bom
  • boolean
  • both
  • breadth
  • btrim
  • by
  • c
  • cache
  • call
  • called
  • cardinality
  • cascade
  • cascaded
  • case
  • cast
  • catalog
  • catalog_name
  • ceil
  • ceiling
  • chain
  • chaining
  • char
  • char_length
  • character
  • character_length
  • character_set_catalog
  • character_set_name
  • character_set_schema
  • characteristics
  • characters
  • check
  • checkpoint
  • class
  • class_origin
  • classifier
  • clob
  • close
  • cluster
  • coalesce
  • cobol
  • collate
  • collation
  • collation_catalog
  • collation_name
  • collation_schema
  • collect
  • column
  • column_name
  • columns
  • command_function
  • command_function_code
  • comment
  • comments
  • commit
  • committed
  • compression
  • concurrently
  • condition
  • condition_number
  • conditional
  • configuration
  • conflict
  • connect
  • connection
  • connection_name
  • constraint
  • constraint_catalog
  • constraint_name
  • constraint_schema
  • constraints
  • constructor
  • contains
  • content
  • continue
  • control
  • conversion
  • convert
  • copartition
  • copy
  • corr
  • corresponding
  • cos
  • cosh
  • cost
  • count
  • covar_pop
  • covar_samp
  • create
  • cross
  • csv
  • cube
  • cume_dist
  • current
  • current_catalog
  • current_date
  • current_default_transform_group
  • current_path
  • current_role
  • current_row
  • current_schema
  • current_time
  • current_timestamp
  • current_transform_group_for_type
  • current_user
  • cursor
  • cursor_name
  • cycle
  • data
  • database
  • datalink
  • date
  • datetime_interval_code
  • datetime_interval_precision
  • day
  • db
  • deallocate
  • dec
  • decfloat
  • decimal
  • declare
  • default
  • defaults
  • deferrable
  • deferred
  • define
  • defined
  • definer
  • degree
  • delete
  • delimiter
  • delimiters
  • dense_rank
  • depends
  • depth
  • deref
  • derived
  • desc
  • describe
  • descriptor
  • detach
  • deterministic
  • diagnostics
  • dictionary
  • disable
  • discard
  • disconnect
  • dispatch
  • distinct
  • dlnewcopy
  • dlpreviouscopy
  • dlurlcomplete
  • dlurlcompleteonly
  • dlurlcompletewrite
  • dlurlpath
  • dlurlpathonly
  • dlurlpathwrite
  • dlurlscheme
  • dlurlserver
  • dlvalue
  • do
  • document
  • domain
  • double
  • drop
  • dynamic
  • dynamic_function
  • dynamic_function_code
  • each
  • element
  • else
  • empty
  • enable
  • encoding
  • encrypted
  • end
  • end-exec
  • end_frame
  • end_partition
  • enforced
  • enum
  • equals
  • error
  • escape
  • event
  • every
  • except
  • exception
  • exclude
  • excluding
  • exclusive
  • exec
  • execute
  • exists
  • exp
  • explain
  • expression
  • extension
  • external
  • extract
  • false
  • family
  • fetch
  • file
  • filter
  • final
  • finalize
  • finish
  • first
  • first_value
  • flag
  • float
  • floor
  • following
  • for
  • force
  • foreign
  • format
  • fortran
  • forward
  • found
  • frame_row
  • free
  • freeze
  • from
  • fs
  • fulfill
  • full
  • function
  • functions
  • fusion
  • g
  • general
  • generated
  • get
  • global
  • go
  • goto
  • grant
  • granted
  • greatest
  • group
  • grouping
  • groups
  • handler
  • having
  • header
  • hex
  • hierarchy
  • hold
  • hour
  • id
  • identity
  • if
  • ignore
  • ilike
  • immediate
  • immediately
  • immutable
  • implementation
  • implicit
  • import
  • in
  • include
  • including
  • increment
  • indent
  • index
  • indexes
  • indicator
  • inherit
  • inherits
  • initial
  • initially
  • inline
  • inner
  • inout
  • input
  • insensitive
  • insert
  • instance
  • instantiable
  • instead
  • int
  • integer
  • integrity
  • intersect
  • intersection
  • interval
  • into
  • invoker
  • is
  • isnull
  • isolation
  • join
  • json
  • json_array
  • json_arrayagg
  • json_exists
  • json_object
  • json_objectagg
  • json_query
  • json_scalar
  • json_serialize
  • json_table
  • json_table_primitive
  • json_value
  • k
  • keep
  • key
  • key_member
  • key_type
  • keys
  • label
  • lag
  • language
  • large
  • last
  • last_value
  • lateral
  • lead
  • leading
  • leakproof
  • least
  • left
  • length
  • level
  • library
  • like
  • like_regex
  • limit
  • link
  • listagg
  • listen
  • ln
  • load
  • local
  • localtime
  • localtimestamp
  • location
  • locator
  • lock
  • locked
  • log
  • log10
  • logged
  • lower
  • lpad
  • ltrim
  • m
  • map
  • mapping
  • match
  • match_number
  • match_recognize
  • matched
  • matches
  • materialized
  • max
  • maxvalue
  • measures
  • member
  • merge
  • merge_action
  • message_length
  • message_octet_length
  • message_text
  • method
  • min
  • minute
  • minvalue
  • mod
  • mode
  • modifies
  • module
  • month
  • more
  • move
  • multiset
  • mumps
  • name
  • names
  • namespace
  • national
  • natural
  • nchar
  • nclob
  • nested
  • nesting
  • new
  • next
  • nfc
  • nfd
  • nfkc
  • nfkd
  • nil
  • no
  • none
  • normalize
  • normalized
  • not
  • nothing
  • notify
  • notnull
  • nowait
  • nth_value
  • ntile
  • null
  • null_ordering
  • nullable
  • nullif
  • nulls
  • number
  • numeric
  • object
  • occurrence
  • occurrences_regex
  • octet_length
  • octets
  • of
  • off
  • offset
  • oids
  • old
  • omit
  • on
  • one
  • only
  • open
  • operator
  • option
  • options
  • or
  • order
  • ordering
  • ordinality
  • others
  • out
  • outer
  • output
  • over
  • overflow
  • overlaps
  • overlay
  • overriding
  • owned
  • owner
  • p
  • pad
  • parallel
  • parameter
  • parameter_mode
  • parameter_name
  • parameter_ordinal_position
  • parameter_specific_catalog
  • parameter_specific_name
  • parameter_specific_schema
  • parser
  • partial
  • partition
  • pascal
  • pass
  • passing
  • passthrough
  • password
  • past
  • path
  • pattern
  • per
  • percent
  • percent_rank
  • percentile_cont
  • percentile_disc
  • period
  • permission
  • permute
  • pipe
  • placing
  • plan
  • plans
  • pli
  • policy
  • portion
  • position
  • position_regex
  • power
  • precedes
  • preceding
  • precision
  • prepare
  • prepared
  • preserve
  • prev
  • primary
  • prior
  • private
  • privileges
  • procedural
  • procedure
  • procedures
  • program
  • prune
  • ptf
  • public
  • publication
  • quote
  • quotes
  • range
  • rank
  • read
  • reads
  • real
  • reassign
  • recheck
  • recovery
  • recursive
  • ref
  • references
  • referencing
  • refresh
  • regr_avgx
  • regr_avgy
  • regr_count
  • regr_intercept
  • regr_r2
  • regr_slope
  • regr_sxx
  • regr_sxy
  • regr_syy
  • reindex
  • relative
  • release
  • rename
  • repeatable
  • replace
  • replica
  • requiring
  • reset
  • respect
  • restart
  • restore
  • restrict
  • result
  • return
  • returned_cardinality
  • returned_length
  • returned_octet_length
  • returned_sqlstate
  • returning
  • returns
  • revoke
  • right
  • role
  • rollback
  • rollup
  • routine
  • routine_catalog
  • routine_name
  • routine_schema
  • routines
  • row
  • row_count
  • row_number
  • rows
  • rpad
  • rtrim
  • rule
  • running
  • savepoint
  • scalar
  • scale
  • schema
  • schema_name
  • schemas
  • scope
  • scope_catalog
  • scope_name
  • scope_schema
  • scroll
  • search
  • second
  • section
  • security
  • seek
  • select
  • selective
  • self
  • semantics
  • sensitive
  • sequence
  • sequences
  • serializable
  • server
  • server_name
  • session
  • session_user
  • set
  • setof
  • sets
  • share
  • show
  • similar
  • simple
  • sin
  • sinh
  • size
  • skip
  • smallint
  • snapshot
  • some
  • sort_direction
  • source
  • space
  • specific
  • specific_name
  • specifictype
  • sql
  • sqlcode
  • sqlerror
  • sqlexception
  • sqlstate
  • sqlwarning
  • sqrt
  • stable
  • standalone
  • start
  • state
  • statement
  • static
  • statistics
  • stddev_pop
  • stddev_samp
  • stdin
  • stdout
  • storage
  • stored
  • strict
  • string
  • strip
  • structure
  • style
  • subclass_origin
  • submultiset
  • subscription
  • subset
  • substring
  • substring_regex
  • succeeds
  • sum
  • support
  • symmetric
  • sysid
  • system
  • system_time
  • system_user
  • t
  • table
  • table_name
  • tables
  • tablesample
  • tablespace
  • tan
  • tanh
  • target
  • temp
  • template
  • temporary
  • text
  • then
  • through
  • ties
  • time
  • timestamp
  • timezone_hour
  • timezone_minute
  • to
  • token
  • top_level_count
  • trailing
  • transaction
  • transaction_active
  • transactions_committed
  • transactions_rolled_back
  • transform
  • transforms
  • translate
  • translate_regex
  • translation
  • treat
  • trigger
  • trigger_catalog
  • trigger_name
  • trigger_schema
  • trim
  • trim_array
  • true
  • truncate
  • trusted
  • type
  • types
  • uescape
  • unbounded
  • uncommitted
  • unconditional
  • under
  • unencrypted
  • union
  • unique
  • unknown
  • unlink
  • unlisten
  • unlogged
  • unmatched
  • unnamed
  • unnest
  • until
  • untyped
  • update
  • upper
  • uri
  • usage
  • user
  • user_defined_type_catalog
  • user_defined_type_code
  • user_defined_type_name
  • user_defined_type_schema
  • using
  • utf16
  • utf32
  • utf8
  • vacuum
  • valid
  • validate
  • validator
  • value
  • value_of
  • values
  • var_pop
  • var_samp
  • varbinary
  • varchar
  • variadic
  • varying
  • verbose
  • version
  • versioning
  • view
  • views
  • volatile
  • when
  • whenever
  • where
  • whitespace
  • width_bucket
  • window
  • with
  • within
  • without
  • work
  • wrapper
  • write
  • xml
  • xmlagg
  • xmlattributes
  • xmlbinary
  • xmlcast
  • xmlcomment
  • xmlconcat
  • xmldeclaration
  • xmldocument
  • xmlelement
  • xmlexists
  • xmlforest
  • xmliterate
  • xmlnamespaces
  • xmlparse
  • xmlpi
  • xmlquery
  • xmlroot
  • xmlschema
  • xmlserialize
  • xmltable
  • xmltext
  • xmlvalidate
  • year
  • yes
  • zone

FEATURE SET

Client Modification Feature

NameSupportedDefined By
BasePathToolingExtension
AuthorizationsToolingExtension
UserAgentToolingExtension
MockServerToolingExtension

Data Type Feature

NameSupportedDefined By
CustomOAS2,OAS3
Int32OAS2,OAS3
Int64OAS2,OAS3
FloatOAS2,OAS3
DoubleOAS2,OAS3
DecimalToolingExtension
StringOAS2,OAS3
ByteOAS2,OAS3
BinaryOAS2,OAS3
BooleanOAS2,OAS3
DateOAS2,OAS3
DateTimeOAS2,OAS3
PasswordOAS2,OAS3
FileOAS2
Uuid
ArrayOAS2,OAS3
NullOAS3
AnyTypeOAS2,OAS3
ObjectOAS2,OAS3
MapsToolingExtension
CollectionFormatOAS2
CollectionFormatMultiOAS2
EnumOAS2,OAS3
ArrayOfEnumToolingExtension
ArrayOfModelToolingExtension
ArrayOfCollectionOfPrimitivesToolingExtension
ArrayOfCollectionOfModelToolingExtension
ArrayOfCollectionOfEnumToolingExtension
MapOfEnumToolingExtension
MapOfModelToolingExtension
MapOfCollectionOfPrimitivesToolingExtension
MapOfCollectionOfModelToolingExtension
MapOfCollectionOfEnumToolingExtension

Documentation Feature

NameSupportedDefined By
ReadmeToolingExtension
ModelToolingExtension
ApiToolingExtension

Global Feature

NameSupportedDefined By
HostOAS2,OAS3
BasePathOAS2,OAS3
InfoOAS2,OAS3
SchemesOAS2,OAS3
PartialSchemesOAS2,OAS3
ConsumesOAS2
ProducesOAS2
ExternalDocumentationOAS2,OAS3
ExamplesOAS2,OAS3
XMLStructureDefinitionsOAS2,OAS3
MultiServerOAS3
ParameterizedServerOAS3
ParameterStylingOAS3
CallbacksOAS3
LinkObjectsOAS3

Parameter Feature

NameSupportedDefined By
PathOAS2,OAS3
QueryOAS2,OAS3
HeaderOAS2,OAS3
BodyOAS2
FormUnencodedOAS2
FormMultipartOAS2
CookieOAS3

Schema Support Feature

NameSupportedDefined By
SimpleOAS2,OAS3
CompositeOAS2,OAS3
PolymorphismOAS2,OAS3
UnionOAS3
allOfOAS2,OAS3
anyOfOAS3
oneOfOAS3
notOAS3

Security Feature

NameSupportedDefined By
BasicAuthOAS2,OAS3
ApiKeyOAS2,OAS3
OpenIDConnectOAS3
BearerTokenOAS3
OAuth2_ImplicitOAS2,OAS3
OAuth2_PasswordOAS2,OAS3
OAuth2_ClientCredentialsOAS2,OAS3
OAuth2_AuthorizationCodeOAS2,OAS3
SignatureAuthOAS3
AWSV4SignatureToolingExtension

Wire Format Feature

NameSupportedDefined By
JSONOAS2,OAS3
XMLOAS2,OAS3
PROTOBUFToolingExtension
CustomOAS2,OAS3