Package edu.caltech.nanodb.commands
Class DDLUtils
- java.lang.Object
-
- edu.caltech.nanodb.commands.DDLUtils
-
public class DDLUtils extends java.lang.Object
This helper class provides some useful functions for constructing keys and indexes and other details for tables that are being initialized.
-
-
Constructor Summary
Constructors Constructor Description DDLUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ForeignKeyColumnRefs
makeForeignKey(Schema tableSchema, TableInfo refTableInfo, ConstraintDecl constraintDecl)
This method constructs aForeignKeyColumnRefs
object that includes the columns named in the input list, as well as the referenced table and column names.
-
-
-
Method Detail
-
makeForeignKey
public static ForeignKeyColumnRefs makeForeignKey(Schema tableSchema, TableInfo refTableInfo, ConstraintDecl constraintDecl)
This method constructs aForeignKeyColumnRefs
object that includes the columns named in the input list, as well as the referenced table and column names. Note that this method does not update the schema stored on disk, or create any other supporting files.- Parameters:
tableSchema
- the schema of the table that the foreign key will be added torefTableInfo
- the table that the foreign key will referenceconstraintDecl
- the parsed constraint declaration describing the foreign key- Returns:
- an object describing the foreign key
- Throws:
SchemaNameException
- if a column-name cannot be found, or if a column-name is ambiguous (unlikely), or if a column is specified multiple times in the input list.
-
-