WORM 0.2
A C++ DAL/ORM code generation framework

Todo List

Namespace WSql

FINISH ME .. comments

CHECKME ..test

Class WSql::WMysqlDriver
uncached results, transactions, prepared statements .. and fix string escaping...

Member WSql::WMysqlDriver::open ()
set connection options here, esp. utf* and friends

Member WSql::WMysqlDriver::query (std::string sql)
RESOLVE - this also escapes LIKE quotes .. need a way to handle this, ie. a general escape/sanitizer method somewhere ..

Member WSql::WMysqlDriver::result (bool iscached=true)

Member WSql::WMysqlDriver::tableMetaData (const std::string &tableName)
change to use strings, defined? and test clm.setColumnName(record.field("Field").data<std::string>()); initColumnType(clm, record.field("Type").data<std::string>()); bool nullable = ! (record.field("Null").data<std::string>().compare("NO") == 0); bool primarykey = (record.field("Key").data<std::string>().compare("PRI") == 0); clm.setDefaultValue( record.field("Default").data<std::string>()); bool isauto = (record.field("Extra").data<std::string>().find("auto_increment") != std::string::npos);

Class WSql::WMysqlResult
uncached results if possible.

Member WSql::WormClassGenerator::setOutputDirectory (const std::string dir)
make portable.

Member WSql::WormClassGenerator::setTemplateDirectory (const std::string dir)
make portable.

Member WSql::WormCodeTemplate::setUri (const std::string &uri)
NOT PORTABLE, FIXME

Member WSql::WSqlColumn::setPrecision (int precision)
the note above ..

Member WSql::WSqlColumn::WSqlColumn (const WSqlColumn &other)
test this!!

Member WSql::WSqlDabataseManager::operator== (const WSqlDabataseManager &other) const
return ...;

Member WSql::WSqlDatabase::hasError () const
resolve this - there is also the local errorStack ..

Member WSql::WSqlDatabase::tableNames (WSql::TableType type=WSql::Tables)

.. decide if we use this ..

Use the table type - currently does nothing.

Member WSql::WSqlDataType::toPlural (const std::string &name)
make me a little smarter .. people, fish, sheep etc.

Member WSql::WSqlDataType::toSingular (const std::string &name)
add intelligence: std::string cmp = boost::to_lower_copy(strToReturn); if(cmp.compare("people") .. or some such ..

Member WSql::WSqlDataType::toType (std::string name)
intelligence - support more type names, translate to ours ..

Member WSql::WSqlDatum::data () const
handle exception

Member WSql::WSqlDatum::setData (const T t)
handle exception

Member WSql::WSqlDriverFactory::operator== (const WSqlDriverFactory &other) const
return ...;

Member WSql::WSqlField::data ()
decide if WSqlField needs/supports this (and other metadata) - also readOnly and so on ..

Member WSql::WSqlField::setData (std::string s)
implement that last sentence . set precision is tbd. To set the value to NULL, use clear().

Class WSql::WSqliteDriver
This driver is unfinished. Basic functionality is there but it is not, ah, elegant. Metadata is incomplete, all results are cached locally and there may be strange behavior. Basically I have done enough to get sufficient metadata for the ORM generator (except indices still) and query() will perform the query and return a result via getResult(). tableNames() works and tableMetaData() works as well (with the above caveats). Transactions are not supported and I seriously doubt that this is thread safe. It quite is crude at the moment - your milage may vary. It _might_ work for you but at this point I don't recommend it for production (10/10/2011)

Member WSql::WSqliteDriver::query (std::string sql)
refactor this using metadata to construct a proper result set .. sqlite doesn't return things in orderly fashion - if a field is empty (i.e. NULL) it just doesn't include it in the results (ARG!), i _think_ and other strange random behavior is observed ..- so, we need to construct a skeleton result set from metadata and then fill it leaving the appropriate gaps such that the field name will _always_ be there. We can't simply refer to tableMetaData as it may be a join or such - which would mean parsing the query, etc..ugly The problem is that we cannot rely on sqlite to return metadata if, for instance, the query returns no results.. Consider using sqlite3_column_metadata. Also, some of this might be better moved to getResult()

Member WSql::WSqliteDriver::tableNames ()
support table type flag .. views, information schema

Member WSql::WSqlRecord::fields () const
THIS maybe should be const std::vector<WSqlField *>& fields() const {return _fields;};

Member WSql::WSqlRecord::operator== (const WSqlRecord &other) const

Member WSql::WSqlRecord::setNull (int i)
template <typename t>=""> void setData( T t, int pos ) {

Member WSql::WSqlRecord::~WSqlRecord ()

Member WSql::WSqlResult::addRecord (WSqlRecord &r)
virtual bool operator==(const WSqlResult& other) const;

Member WSql::WSqlResult::seek (int i, bool relative=false)
test this
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Defines