/** * Creates the 'gui_schema'. A schema in which to store the GlobalUniqueIndexes. The 'gui_schema' always already exist and is pre-loaded in {@link Topology()} @see {@link Topology#cacheTopology()} * * @param topology The {@link Topology} that contains the public schema. * @return The Schema that represents 'public' */ static Schema createGlobalUniqueIndexSchema(Topology topology) { return new Schema(topology, GLOBAL_UNIQUE_INDEX_SCHEMA); }
/** * Creates the SqlgSchema. The sqlg_schema always exist and is created via sql in {@link SqlDialect#sqlgTopologyCreationScripts()} * * @param topology A reference to the {@link Topology} that contains the sqlg_schema schema. * @return The Schema that represents 'sqlg_schema' */ static Schema instantiateSqlgSchema(Topology topology) { return new Schema(topology, SQLG_SCHEMA); }
/** * Creates the SqlgSchema. The sqlg_schema always exist and is created via sql in {@link SqlDialect#sqlgTopologyCreationScripts()} * * @param topology A reference to the {@link Topology} that contains the sqlg_schema schema. * @return The Schema that represents 'sqlg_schema' */ static Schema instantiateSqlgSchema(Topology topology) { return new Schema(topology, SQLG_SCHEMA); }
/** * Only called from {@link Topology#fromNotifyJson(int, LocalDateTime)} * * @param topology The {@link Topology} * @param schemaName The schema's name * @return The Schema that has already been created by another graph. */ static Schema instantiateSchema(Topology topology, String schemaName) { return new Schema(topology, schemaName); }
/** * Loads the existing schema from the topology. * * @param topology The {@link Topology} that contains this schema. * @param schemaName The schema's name. * @return The loaded Schema. */ static Schema loadUserSchema(Topology topology, String schemaName) { return new Schema(topology, schemaName); }
/** * Creates the 'gui_schema'. A schema in which to store the GlobalUniqueIndexes. The 'gui_schema' always already exist and is pre-loaded in {@link Topology()} @see {@link Topology#cacheTopology()} * * @param topology The {@link Topology} that contains the public schema. * @return The Schema that represents 'public' */ static Schema createGlobalUniqueIndexSchema(Topology topology) { return new Schema(topology, GLOBAL_UNIQUE_INDEX_SCHEMA); }
/** * Only called from {@link Topology#fromNotifyJson(int, LocalDateTime)} * * @param topology The {@link Topology} * @param schemaName The schema's name * @return The Schema that has already been created by another graph. */ static Schema instantiateSchema(Topology topology, String schemaName) { return new Schema(topology, schemaName); }
/** * Loads the existing schema from the topology. * * @param topology The {@link Topology} that contains this schema. * @param schemaName The schema's name. * @return The loaded Schema. */ static Schema loadUserSchema(Topology topology, String schemaName) { return new Schema(topology, schemaName); }
static Schema createSchema(SqlgGraph sqlgGraph, Topology topology, String name) { Schema schema = new Schema(topology, name); Preconditions.checkArgument(!name.equals(SQLG_SCHEMA) && !sqlgGraph.getSqlDialect().getPublicSchema().equals(name), "createSchema may not be called for 'sqlg_schema' or 'public'"); schema.createSchemaOnDb(); TopologyManager.addSchema(sqlgGraph, name); schema.committed = false; return schema; }
static Schema createSchema(SqlgGraph sqlgGraph, Topology topology, String name) { Schema schema = new Schema(topology, name); Preconditions.checkArgument(!name.equals(SQLG_SCHEMA) && !sqlgGraph.getSqlDialect().getPublicSchema().equals(name), "createSchema may not be called for 'sqlg_schema' or 'public'"); schema.createSchemaOnDb(); TopologyManager.addSchema(sqlgGraph, name); schema.committed = false; return schema; }
/** * Creates the 'public' schema that always already exist and is pre-loaded in {@link Topology()} @see {@link Topology#cacheTopology()} * * @param publicSchemaName The 'public' schema's name. Sometimes its upper case (Hsqldb) sometimes lower (Postgresql) * @param topology The {@link Topology} that contains the public schema. * @return The Schema that represents 'public' */ static Schema createPublicSchema(SqlgGraph sqlgGraph, Topology topology, String publicSchemaName) { Schema schema = new Schema(topology, publicSchemaName); if (!existPublicSchema(sqlgGraph)) { schema.createSchemaOnDb(); } schema.committed = false; return schema; }
/** * Creates the 'public' schema that always already exist and is pre-loaded in {@link Topology()} @see {@link Topology#cacheTopology()} * * @param publicSchemaName The 'public' schema's name. Sometimes its upper case (Hsqldb) sometimes lower (Postgresql) * @param topology The {@link Topology} that contains the public schema. * @return The Schema that represents 'public' */ static Schema createPublicSchema(SqlgGraph sqlgGraph, Topology topology, String publicSchemaName) { Schema schema = new Schema(topology, publicSchemaName); if (!existPublicSchema(sqlgGraph)) { schema.createSchemaOnDb(); } schema.committed = false; return schema; }