Skip to content

Commit

Permalink
Adds a singleton system catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Dec 6, 2024
1 parent 628c1db commit d1b3305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* <p>
* This implements the PartiQL System Catalog.
* This package-private class implements the PartiQL System Catalog.
* </p>
* <p>
* It provides the implementation for the PartiQL System Catalog, which is a built-in catalog
Expand All @@ -20,24 +20,18 @@
*/
final class PartiQLSystemCatalog implements Catalog {

/**
* TODO
*/
@NotNull
private final String name;
private static final String NAME = "$system";

/**
* Creates a new PartiQL System Catalog with the given name.
* @param name the name of the PartiQL System Catalog
* This is a package-private singleton.
*/
PartiQLSystemCatalog(@NotNull String name) {
this.name = name;
}
static PartiQLSystemCatalog INSTANCE = new PartiQLSystemCatalog();

@NotNull
@Override
public String getName() {
return this.name;
return NAME;
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public interface Session {

private var identity: String = "unknown"
private var catalog: String? = null
private var systemCatalog: Catalog = PartiQLSystemCatalog("\$system")
private var systemCatalog: Catalog = PartiQLSystemCatalog.INSTANCE
private var catalogs: Catalogs.Builder = Catalogs.builder()
private var namespace: Namespace = Namespace.empty()
private var properties: MutableMap<String, String> = mutableMapOf()
Expand Down

0 comments on commit d1b3305

Please sign in to comment.