Builder3/Window.js
[app.Builder.js] / dbgenerate.js
index 5737442..e81c5ae 100644 (file)
  * 
  * write readers..
  * 
- * usage: seed generate.js  
+ * usage: seed generate.js
+ *
+ *
+ *
+ *
+ *Hack needed to latest GLib-2.0.gir 
+ *
+ * <record name="KeyFile" c:type="GKeyFile" disguised="1">
+       <constructor name="new" c:identifier="g_key_file_new">
+        <return-value transfer-ownership="full">
+          <type name="KeyFile" c:type="GKeyFile*"/>
+        </return-value>
+      </constructor>
+ *
+ *
+ * remove introspectable =0 from g_key_file_get_groups
+ *   and add transfer-owneership = none to return value
+ * remove introspectable =0 from g_key_file_get_keys
+ *   and add transfer-owneership = none to return value* 
  * 
  */
 Gda  = imports.gi.Gda;
@@ -25,7 +43,7 @@ console = imports.console;
 File = imports.File.File;
 Options = imports.Options.Options;
 
-Gda.init();
+//Gda.init();
 
 var prov = Gda.Config.list_providers ();
 //print(prov.dump_as_string());
@@ -102,6 +120,7 @@ var map = {
     'bigint' : 'int',
     'double' : 'float',
     'tinyint' : 'int',
+    'smallint' : 'int',
     'decimal' : 'float',
     'float' : 'float',
     'char' : 'string',
@@ -129,9 +148,10 @@ function readIni(fn)
     var groups = key_file.get_groups();
     groups.forEach(function(g) {
         ini[g] = {}
-           
+           print("KEY:"+g);
         var keys = key_file.get_keys(g);
-        keys.forEach(function(k) {
+        if (!keys) { return; }
+         keys.forEach(function(k) {
             ini[g][k] = key_file.get_value(g,k);
         })
     })
@@ -145,6 +165,7 @@ if (File.isFile(cfg.INI)) {
     }
 }
 
+
 if (File.isDirectory(cfg.INI)) {