Skip to content

Commit

Permalink
sql/postgres: add storage params constants (#3341)
Browse files Browse the repository at this point in the history
  • Loading branch information
a8m authored Jan 26, 2025
1 parent 010afd3 commit eaf4727
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
8 changes: 8 additions & 0 deletions schemahcl/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,14 @@ func Int64Attr(k string, v int64) *Attr {
}
}

// Float64Attr is a helper method for constructing *schemahcl.Attr instances that contain float64 value.
func Float64Attr(k string, v float64) *Attr {
return &Attr{
K: k,
V: cty.NumberFloatVal(v),
}
}

// BoolAttr is a helper method for constructing *schemahcl.Attr instances that contain a boolean value.
func BoolAttr(k string, v bool) *Attr {
return &Attr{
Expand Down
34 changes: 27 additions & 7 deletions sql/postgres/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,33 @@ const (

// List of supported index types.
const (
IndexTypeBTree = "BTREE"
IndexTypeBRIN = "BRIN"
IndexTypeHash = "HASH"
IndexTypeGIN = "GIN"
IndexTypeGiST = "GIST"
IndexTypeSPGiST = "SPGIST"
defaultPagePerRange = 128
IndexTypeBTree = "BTREE"
IndexTypeBRIN = "BRIN"
IndexTypeHash = "HASH"
IndexTypeGIN = "GIN"
IndexTypeGiST = "GIST"
IndexTypeSPGiST = "SPGIST"
defaultPagesPerRange = 128
defaultListLimit = 4 * 1024
defaultBtreeFill = 90
)

const (
storageParamFillFactor = "fillfactor"
storageParamDedup = "deduplicate_items"
storageParamBuffering = "buffering"
storageParamFastUpdate = "fastupdate"
storageParamListLimit = "gin_pending_list_limit"
storageParamPagesRange = "pages_per_range"
storageParamAutoSum = "autosummarize"
)

const (
bufferingOff = "OFF"
bufferingOn = "ON"
bufferingAuto = "AUTO"
storageParamOn = "ON"
storageParamOff = "OFF"
)

// List of "GENERATED" types.
Expand Down

0 comments on commit eaf4727

Please sign in to comment.