iceberg-kitten commented on code in PR #2612:
URL: https://github.com/apache/iceberg-go/pull/2612#discussion_r4612272112
##########
catalog/sql/sql.go:
##########
@@ -587,26 +423,38 @@ func (c *Catalog) isV0() bool { return c.schemaVersion ==
schemaV0 }
// of catalog changes.
//
// SQLite callers that allow concurrent writers should configure WAL and a
busy timeout in the driver DSN so the
-// settings apply to every pooled connection, for example
"?_busy_timeout=5000", which both drivers sqliteshim
-// selects accept. Write transactions take SQLite's write lock before they
read, so concurrent writers queue for up
-// to the busy timeout, or until the context's deadline if that is sooner,
instead of failing with SQLITE_BUSY.
-// The driver's default applies when the DSN sets none: mattn waits 5000ms,
while modernc does not wait, so
-// CreateTable, CreateView and the other operations that retry on a lock
conflict give up after about 310ms and the
-// rest fail at once. NewCatalog does not mutate connection settings on the
caller-owned db.
-func NewCatalog(ctx context.Context, name string, db *sql.DB, dialect
SupportedDialect, props iceberg.Properties) (*Catalog, error) {
+// settings apply to every pooled connection. NewCatalog does not mutate
connection settings on the caller-owned db.
+//
+// Use NewCatalogWithOptions and WithIORegistry(registry) for isolated FileIO
factories for table
+// and view metadata. Omitting this option or passing nil uses global FileIO.
+// The registry is shared, not copied; later changes affect future loads and
+// metadata writes. The caller continues to own db.
+func NewCatalog(name string, db *sql.DB, dialect SupportedDialect, props
iceberg.Properties) (*Catalog, error) {
+ return NewCatalogWithOptions(name, db, dialect, props)
+}
+
+// NewCatalogWithOptions creates a SQL catalog with optional configuration.
+// WithIORegistry selects a catalog-scoped FileIO registry; without it, global
FileIO is used.
+func NewCatalogWithOptions(name string, db *sql.DB, dialect SupportedDialect,
props iceberg.Properties, opts ...Option) (*Catalog, error) {
Review Comment:
Yep, the current head is back to variadic options on the existing SQL,
Hadoop and view functions. I dropped the extra SQL comment too. Mind taking
another look?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]