--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Thanks for digging into that issue.
Let me know if you find some rough spots. I'm still working on date issues, but most other basic types should work.
So I would like to know if you project to add a postgre implementation ? If I understood properly, in the past this was the case so if it's true why did you stop postgreSQL support ? Have you a proper method for Manager works with PostgreSQL language and MySQL language
public function quoteTableName(tableName : String) : String { var postgreDB : Bool = (cnx.dbName() == "PostgreSQL"); return (postgreDB ? "\"" : "") + tableName + (postgreDB ? "\"" : ""); }
public function all( ?lock: Bool ) : List<T> { return unsafeObjects("SELECT * FROM " + quoteTableName(table_name),lock); }
public function dynamicSearch( x : {}, ?lock : Bool ) : List<T> { var s = new StringBuf(); s.add("SELECT * FROM "); s.add(quoteTableName(table_name)); s.add(" WHERE "); addCondition(s,x); return unsafeObjects(s.toString(),lock); }
s.add("INSERT INTO "); s.add(quoteTableName(table_name)); s.add(" (\""); s.add(fields.join("\", \"")); s.add("\") VALUES ("); var first = true;
var s = new StringBuf();s.add("UPDATE ");s.add(quoteTableName(table_name));s.add(" SET ");de here...
function doDelete( x : T ) { var s = new StringBuf(); s.add("DELETE FROM "); s.add(quoteTableName(table_name)); s.add(" WHERE "); addKeys(s,x); unsafeExecute(s.toString()); removeFromCache(x); }
function doLock( i : T ) { if( untyped i._lock ) return; var s = new StringBuf(); s.add("SELECT * FROM "); s.add(quoteTableName(table_name)); s.add(" WHERE "); addKeys(s, i); // will force sync if( unsafeObject(s.toString(),true) != i ) throw "Could not lock object (was deleted ?); try restarting transaction"; }
public function unsafeGet( id : Dynamic, ?lock : Bool ) : T { if( lock == null ) lock = true; if( table_keys.length != 1 ) throw "Invalid number of keys"; if( id == null ) return null; var x : Dynamic = getFromCacheKey(Std.string(id) + table_name); if( x != null && (!lock || x._lock) ) return x; var s = new StringBuf(); s.add("SELECT * FROM "); s.add(quoteTableName(table_name)); s.add(" WHERE "); s.add(quoteField(table_keys[0])); s.add(" = "); getCnx().addValue(s,id); return unsafeObject(s.toString(), lock); }
public function unsafeGetWithKeys( keys : { }, ?lock : Bool ) : T { if( lock == null ) lock = true; var x : Dynamic = getFromCacheKey(makeCacheKey(cast keys)); if( x != null && (!lock || x._lock) ) return x; var s = new StringBuf(); s.add("SELECT * FROM "); s.add(quoteTableName(table_name)); s.add(" WHERE "); addKeys(s,keys); return unsafeObject(s.toString(),lock); }
//WARNING : It breaks MySQL Compatibility function quoteField( f : String ) { //var m : { private var KEYWORDS : haxe.ds.StringMap<Bool>; } = PATCHManager; return /*m.KEYWORDS.exists(f.toLowerCase()) ? "`"+f+"`" :*/ f; }