Difference between revisions of "PostgreSQL Adapter Project - Extending SQLSchemaManager"
AnastasiaS (talk | contribs) (→Task Summary) |
(→Task Summary) |
||
Line 29: | Line 29: | ||
| Implement <code>appendColumnType()</code> method | | Implement <code>appendColumnType()</code> method | ||
| DONE | | DONE | ||
− | | | + | | DONE |
|- | |- | ||
| Implement <code>appendConcatenate()</code> method | | Implement <code>appendConcatenate()</code> method | ||
| DONE | | DONE | ||
− | | | + | | DONE |
|- | |- | ||
| Implement <code>appendPrint()</code> method | | Implement <code>appendPrint()</code> method | ||
Line 49: | Line 49: | ||
| Implement <code>appendTSExtract()</code> method | | Implement <code>appendTSExtract()</code> method | ||
| DONE | | DONE | ||
− | | | + | | DONE |
|- | |- | ||
| Add <code>appendTSField</code> method <br /> *NOTE: It is used in <code>appendTSExtract()</code> method,<br /> and it is quite similar to the one in MySQL. <br />(Suggest to NexJ to add it to the super class) | | Add <code>appendTSField</code> method <br /> *NOTE: It is used in <code>appendTSExtract()</code> method,<br /> and it is quite similar to the one in MySQL. <br />(Suggest to NexJ to add it to the super class) | ||
| DONE | | DONE | ||
− | | | + | | DONE |
|- | |- | ||
| Implement <code>appendTSIncrement()</code> method | | Implement <code>appendTSIncrement()</code> method | ||
| DONE | | DONE | ||
− | | | + | | DONE |
|- | |- | ||
| Implement <code>getCreateEtcScriptName()</code> method | | Implement <code>getCreateEtcScriptName()</code> method | ||
Line 85: | Line 85: | ||
| Implement <code>getGUIDExpr()</code> method | | Implement <code>getGUIDExpr()</code> method | ||
| DONE | | DONE | ||
− | | | + | | DONE |
|- | |- | ||
| Implement <code>getNowExpr()</code> method | | Implement <code>getNowExpr()</code> method |
Revision as of 15:34, 25 January 2011
PostgreSQL Adapter for NexJ - Extending SQL Schema Manager
- SQLSchemaManager is used in maintaining database schemas (DDL)
Contents
Task Summary
Task | Status | Test Status |
---|---|---|
Extend SQLSchemaManager to support PostgreSQL | DONE | DONE |
Research and add Maximum column Precision | DONE | |
Figure out Data Type Mapping | DONE | |
Implement analyzeTable
|
Ask NexJ, what this should do | |
Implement appendColumnType() method
|
DONE | DONE |
Implement appendConcatenate() method
|
DONE | DONE |
Implement appendPrint() method
|
DONE | |
Implement appendUpgradeStepEnd() method
|
||
Implement appendUpgradeStepStart() method
|
||
Implement appendTSExtract() method
|
DONE | DONE |
Add appendTSField method *NOTE: It is used in appendTSExtract() method,and it is quite similar to the one in MySQL. (Suggest to NexJ to add it to the super class) |
DONE | DONE |
Implement appendTSIncrement() method
|
DONE | DONE |
Implement getCreateEtcScriptName() method
|
DONE | |
Implement getDefaultIndexspace() method
|
DONE | |
Implement getDefaultLongspace() method
|
DONE | DONE |
Implement getDefaultTablespace() method
|
DONE | |
Implement getDropEtcScriptName() method
|
||
Implement getDynamicSQLAppender() method
|
||
Implement getGUIDExpr() method
|
DONE | DONE |
Implement getNowExpr() method
|
DONE | |
Implement getSeparator() method
|
DONE | |
Implement getSetupEtcScriptName() method
|
DONE | |
Override renameTable [1]
|
||
Override renameColumn [2]
|
||
Override renameIndex [3]
|
||
Override getIndexName()
|
DONE | |
Port mysql_insert.sql script to postgresql_insert
|
DONE | DONE |
Task Details
Extend SQLSchemaManager to support PostgreSQL
Create a new class PostgreSQLSchemaManager by extending SQLSchemaManager and implementing all necessary abstract classes
Research and add Maximum column Precision
Following are the Maximum column precisions we might need to establish:
(All constants are defined in PostgreSQLAdapter class)
- DEFAULT_FETCH_SIZE
- MAX_CHAR_PRECISION
- MAX_VARCHAR_PRECISION
- MAX_BINARY_PRECISION
- MAX_VARBINARY_PRECISION
- MAX_REAL_PRECISION
- TIMESTAMP_FORMAT_SQL
- TIMESTAMP_FORMAT
Figure out Data Type Mapping
http://www.postgresql.org/docs/current/static/datatype.html
- Go over all data types offered in PostgreSQL
- Map types defined in
Primitive
class
Implement appendColumnType()
method
This method appends a table column type declaration to a string buffer.
- use logic and mapping to append required column data types to incoming string.
- Test it
Implement appendTSExtract()
method
This method extracts a field from a timestamp. It uses SQLSubstReaser
's enums.
- Research the extract function in the PostgreSQL
- Implement it in Adapter
- Test it
- NOTE: The logic to implement the extract function is similar to the one in MySQL Adapter. It could be a good idea to suggest to NexJ to add the
appendTSField
method to the super class, so we are not repeating the code. (Can be done in the Optimization stage)