Package com.zendesk.maxwell.schema
Interface SchemaStore
-
- All Known Implementing Classes:
MysqlSchemaStore,RecoverySchemaStore
public interface SchemaStore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SchemagetSchema()Retrieve the current schema If no Stored schema is found, this method should capture and save a snapshot of the current mysql schema.LonggetSchemaID()Retrieve current schema id Schema id should be an always increasing integer, not current intended for use to refernce the schema, simply as a schema generation indicator.List<ResolvedSchemaChange>processSQL(String sql, String currentDatabase, Position position)Process a DDL statement Parse the given SQL, applying the changes to the schema.
-
-
-
Method Detail
-
getSchema
Schema getSchema() throws SchemaStoreException
Retrieve the current schema If no Stored schema is found, this method should capture and save a snapshot of the current mysql schema.- Returns:
- The schema, either retrieved from storage or captured.
- Throws:
SchemaStoreException- if we have issues gettng the schema
-
processSQL
List<ResolvedSchemaChange> processSQL(String sql, String currentDatabase, Position position) throws SchemaStoreException, InvalidSchemaError
Process a DDL statement Parse the given SQL, applying the changes to the schema. Returns a list of ResolvedSchemaChange objects, representing the DDL that was applied (if any)- Parameters:
sql- The SQL of the DDL statementcurrentDatabase- The "contextual database" of the DDL statementposition- The position of the DDL statement- Returns:
- A list of the schema changes parsed from the SQL.
- Throws:
SchemaStoreException- if we have trouble processing or storing the schema changeInvalidSchemaError- if we find the schema to be in a bad state
-
getSchemaID
Long getSchemaID() throws SchemaStoreException
Retrieve current schema id Schema id should be an always increasing integer, not current intended for use to refernce the schema, simply as a schema generation indicator.- Returns:
- The current schema id
- Throws:
SchemaStoreException- if we have trouble getting the schema id
-
-