Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql/postgres: add storage params constants #3341

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading