PostgreSQL Adapter Project - Code Review 2 Changes

From CDOT Wiki
Revision as of 10:18, 12 July 2011 by Gbatumbya (talk | contribs) (PostgreSQLSchemaManager)
Jump to: navigation, search

General

  • Run server with connections file that has no port

Research

Task Outcome
Why does DB add quotes to column names that where not original quoted e.g. if a column name contains $ ?
Check meta data that jdbc driver returns if column names are quoted e.g. name, value, cache
Check what happens if table with column sizes that exceeds page size for a row. If there is limit, then move virtual columns to tables instead
Are postgresql functions atomic?
Check if size of column storage for characters can be specified
What is the maximum return value for full-text search?


Classes

Fix repository (DONE - Recreated the repository)

  • Remove changeset that overwrites changes that came from NexJ repository


PostgreSQLAdapter

Task Status UnitTest
shared Logic with PostgreSQLSchemaManager
  • move logic to PostgreSQLSchemaManager
  • on instantiation create reference to PostgreSQLSchemaManager
  • reference schema manager for shared logic
DONE
variables for reflection
  • change names to full method/variable name
  • remove integer declaration for write modes
  • get methods from interfaces and not implementations
  • remove unnecessary class declarations
DONE
BINB_BLOB
  • move check for PGXAConnection to first step and let super handle
DONE
s_bindFactoryArray
  • change static initialization to first copy array and then overwrite with custom binds
DONE
appendMatchExpression
  • MUTT just do append OR, look at matchOperatorTest for how to extract arguments from Pair object
appendSuffixHint
  • change logic to use one buffer
DONE
appendTypeConversion
  • check bool <-> string
  • check for new log for if(op instead d) in MySQLAdapter
isUnicode
  • remove table alias from query
  • modify logic to check column type and if character then check unicode
DONE
caseInsensitive
  • change from LOWER to UPPER
indexNameMatches
  • check if toDatabaseCase is required
executeQuery
  • if cannot get QueryExecutor instead synchronize on connection
BIND_BLOB
  • track down why connection used for unittests has autoCommit enabled
unwrap
  • Override unwrap and move logic in getPostgreSQLConnection to this method
DONE

PostgreSQLSchemaManager

Task Status UnitTest
column iterator
  • instead use table.columnCount
Comparing Primitive
  • no need to use getOrdinal
isLOB
  • use max_field_size for both
getOwner
  • update all code that requires owner, since default owner now exists
getDependentViews
  • check for similarities with original implementation
appendColumnType
  • Primitive.String use isCLOB, remove check from nPrecision
renameTable / renameColumn
  • recreate the tiggers/procedures instead of dropping and recreating the helper column
appendColumnAlteration
  • ensure BLOB data is not being lost
appendIndexSuffix
  • remove indexfill limits check
  • change to first add tablespace then index fill
  • for index fill less than 10, set to 10
isValidColumnName
  • use && instead
toMetaDatacase
  • check if value returned by super implementation works
toMetaDatacase / isCaseInsensitiveColumn
  • Move logic to strip enclosing quotes from returned values in to metaDatacase
getCaseSensitiveName
  • check if it is needed if code is implemented that strips off quotations from metadata
isImplicitConversion
  • start off by returning true, run unit test and for those that fail, return false
unlinkLargeObjects
  • change to 2 implementations that take a table and a column
alterColumn
  • When BLOB column is created, create triggers for lo_manage
  • After case when columns do not match, return
dropFulltextProcedure
  • remove string concatenation
createFulltextProcedure / dropFulltextProcedure
  • make inline
dropTable
  • move drop procedure before super call
  • rename unneeded buf.setLength
dummyviews
  • use comment to store old select statement
getTableName
  • implement where returns quoted tableName without schema
renameTable
  • merge dropFulltextTrigger and Procedure
getIndexName
  • use index.getName(Table)
appendTSIncrement
  • quarter use interval'3 months'
makeViewDummy
  • Rename Method name
  • Add comment to dummy view with original statement

CaseInsensitiveSQLSchemaManager

Task Status UnitTest
appendSeparator / getAlterColumnToken
  • remove appendSeparator
  • add a flag (bSep) where to add separator or not


PostgreSQLAdapterTest

Task Status UnitTest
isComptatibleVersion
  • just return true
getUnicodeCheckGuard
  • use simpler logic


sql.AllTests

Task Status UnitTest
default.config
  • enable both MySQL and PostgreSQL


SQLSchemaManager

Task Status UnitTest
isWindowsCompatiable
  • just pass in property file
  • change logic to not use loop
setMetadataDatabaseProperties
  • move statement for owner property to place in alphabetical order


SQLCursor

Task Status UnitTest
create wrapper for preparestatement
  • implement timer logic in wrapper object


JBossInstaller

Task Status UnitTest
installLoginConfig
  • use sqlAdapter.appendLiteral

Scripts

  • Remove empty script files

postgresql_setup.sql

Task Status UnitTest
encoding and collation
  • get values from custom properties
add comment that locktimeout exception is not support on postgresql
add procedure to check that all contrib modules have been installed