src/hg/instinct/lib/raDb.c 1.1

1.1 2010/04/12 17:16:10 jsanborn
added raDb functionality
Index: src/hg/instinct/lib/raDb.c
===================================================================
RCS file: src/hg/instinct/lib/raDb.c
diff -N src/hg/instinct/lib/raDb.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/hg/instinct/lib/raDb.c	12 Apr 2010 17:16:10 -0000	1.1
@@ -0,0 +1,784 @@
+/* raDb.c was originally generated by the autoSql program, which also 
+ * generated raDb.h and raDb.sql.  This module links the database and
+ * the RAM representation of objects. */
+
+#include "common.h"
+#include "linefile.h"
+#include "dystring.h"
+#include "jksql.h"
+#include "raDb.h"
+
+static char const rcsid[] = "$Id$";
+
+void raDbStaticLoadWithNull(char **row, struct raDb *ret)
+/* Load a row from raDb table into ret.  The contents of ret will
+ * be replaced at the next call to this function. */
+{
+
+if (row[0] != NULL)
+    {
+    ret->id = needMem(sizeof(*(ret->id)));
+    *(ret->id) = sqlUnsigned(row[0]);
+    }
+else
+    {
+    ret->id = NULL;
+    }
+ret->name = row[1];
+ret->accessTable = row[2];
+ret->shortLabel = row[3];
+ret->longLabel = row[4];
+if (row[5] != NULL)
+    {
+    ret->expCount = needMem(sizeof(*(ret->expCount)));
+    *(ret->expCount) = sqlUnsigned(row[5]);
+    }
+else
+    {
+    ret->expCount = NULL;
+    }
+if (row[6] != NULL)
+    {
+    ret->height = needMem(sizeof(*(ret->height)));
+    *(ret->height) = sqlUnsigned(row[6]);
+    }
+else
+    {
+    ret->height = NULL;
+    }
+ret->groupName = row[7];
+ret->raFile = row[8];
+ret->patDb = row[9];
+ret->sampleField = row[10];
+ret->patTable = row[11];
+ret->patField = row[12];
+ret->aliasTable = row[13];
+ret->displayNameTable = row[14];
+ret->dataType = row[15];
+ret->platform = row[16];
+if (row[17] != NULL)
+    {
+    ret->expScale = needMem(sizeof(float));
+    *(ret->expScale) = sqlFloat(row[17]);
+    }
+if (row[18] != NULL)
+    {
+    ret->gainFull = needMem(sizeof(float));
+    *(ret->gainFull) = sqlFloat(row[18]);
+    }
+if (row[19] != NULL)
+    {
+    ret->gainSet = needMem(sizeof(float));
+    *(ret->gainSet) = sqlFloat(row[19]);
+    }
+ret->type = row[20];
+ret->visibility = row[21];
+if (row[22] != NULL)
+    {
+    ret->priority = needMem(sizeof(float));
+    *(ret->priority) = sqlFloat(row[22]);
+    }
+ret->url = row[23];
+ret->security = row[24];
+ret->local_url = row[25];
+ret->profile = row[26];
+ret->wrangler = row[27];
+ret->citation = row[28];
+ret->article_title = row[29];
+ret->author_list = row[30];
+ret->wrangling_procedure = row[31];
+}
+
+struct raDb *raDbLoadByQuery(struct sqlConnection *conn, char *query)
+/* Load all raDb from table that satisfy the query given.  
+ * Where query is of the form 'select * from example where something=something'
+ * or 'select example.* from example, anotherTable where example.something = 
+ * anotherTable.something'.
+ * Dispose of this with raDbFreeList(). */
+{
+struct raDb *list = NULL, *el;
+struct sqlResult *sr;
+char **row;
+
+sr = sqlGetResult(conn, query);
+while ((row = sqlNextRow(sr)) != NULL)
+    {
+    el = raDbLoadWithNull(row);
+    slAddHead(&list, el);
+    }
+slReverse(&list);
+sqlFreeResult(&sr);
+return list;
+}
+
+void raDbSaveToDb(struct sqlConnection *conn, struct raDb *el, char *tableName, int updateSize)
+/* Save raDb as a row to the table specified by tableName. 
+ * As blob fields may be arbitrary size updateSize specifies the approx size
+ * of a string that would contain the entire query. Arrays of native types are
+ * converted to comma separated strings and loaded as such, User defined types are
+ * inserted as NULL. Note that strings must be escaped to allow insertion into the database.
+ * For example "autosql's features include" --> "autosql\'s features include" 
+ * If worried about this use raDbSaveToDbEscaped() */
+{
+struct dyString *update = newDyString(updateSize);
+dyStringPrintf(update, "insert into %s values ( %u,'%s','%s','%s','%s',%u,%u,'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',%g,%g,%g,'%s','%s',%g,'%s','%s','%s','%s','%s','%s','%s','%s','%s')", 
+	tableName,  *(el->id),  el->name,  el->accessTable,  el->shortLabel,  el->longLabel,  *(el->expCount),  *(el->height),  el->groupName,  el->raFile,  el->patDb,  el->sampleField,  el->patTable,  el->patField,  el->aliasTable,  el->displayNameTable,  el->dataType,  el->platform,  *(el->expScale),  *(el->gainFull),  *(el->gainSet),  el->type,  el->visibility,  *(el->priority),  el->url,  el->security,  el->local_url,  el->profile,  el->wrangler,  el->citation, (el->article_title), (el->author_list),  (el->wrangling_procedure));
+sqlUpdate(conn, update->string);
+freeDyString(&update);
+}
+
+void raDbSaveToDbEscaped(struct sqlConnection *conn, struct raDb *el, char *tableName, int updateSize)
+/* Save raDb as a row to the table specified by tableName. 
+ * As blob fields may be arbitrary size updateSize specifies the approx size.
+ * of a string that would contain the entire query. Automatically 
+ * escapes all simple strings (not arrays of string) but may be slower than raDbSaveToDb().
+ * For example automatically copies and converts: 
+ * "autosql's features include" --> "autosql\'s features include" 
+ * before inserting into database. */ 
+{
+struct dyString *update = newDyString(updateSize);
+char  *name, *accessTable, *shortLabel, *longLabel, *groupName, *raFile, *patDb, *sampleField, *patTable, *patField, *aliasTable, *displayNameTable, *dataType, *platform, *type, *visibility, *url, *security, *local_url, *profile, *wrangler, *citation, *article_title, *author_list, *wrangling_procedure;
+name = sqlEscapeString(el->name);
+accessTable = sqlEscapeString(el->accessTable);
+shortLabel = sqlEscapeString(el->shortLabel);
+longLabel = sqlEscapeString(el->longLabel);
+groupName = sqlEscapeString(el->groupName);
+raFile = sqlEscapeString(el->raFile);
+patDb = sqlEscapeString(el->patDb);
+sampleField = sqlEscapeString(el->sampleField);
+patTable = sqlEscapeString(el->patTable);
+patField = sqlEscapeString(el->patField);
+aliasTable = sqlEscapeString(el->aliasTable);
+displayNameTable = sqlEscapeString(el->displayNameTable);
+dataType = sqlEscapeString(el->dataType);
+platform = sqlEscapeString(el->platform);
+type = sqlEscapeString(el->type);
+visibility = sqlEscapeString(el->visibility);
+url = sqlEscapeString(el->url);
+security = sqlEscapeString(el->security);
+local_url = sqlEscapeString(el->local_url);
+profile = sqlEscapeString(el->profile);
+wrangler = sqlEscapeString(el->wrangler);
+citation = sqlEscapeString(el->citation);
+article_title = sqlEscapeString(el->article_title);
+author_list = sqlEscapeString(el->author_list);
+wrangling_procedure = sqlEscapeString(el->wrangling_procedure);
+
+dyStringPrintf(update, "insert into %s values ( %u,'%s','%s','%s','%s',%u,%u,'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',%g,%g,%g,'%s','%s',%g,'%s','%s','%s','%s','%s','%s','%s','%s','%s')", 
+	tableName,  *(el->id),  name,  accessTable,  shortLabel,  longLabel,  *(el->expCount),  *(el->height),  groupName,  raFile,  patDb,  sampleField,  patTable,  patField,  aliasTable,  displayNameTable,  dataType,  platform,  *(el->expScale),  *(el->gainFull),  *(el->gainSet),  type,  visibility,  *(el->priority),  url,  security,  local_url,  profile,  wrangler,  citation,  article_title,  author_list,  wrangling_procedure);
+sqlUpdate(conn, update->string);
+freeDyString(&update);
+freez(&name);
+freez(&accessTable);
+freez(&shortLabel);
+freez(&longLabel);
+freez(&groupName);
+freez(&raFile);
+freez(&patDb);
+freez(&sampleField);
+freez(&patTable);
+freez(&patField);
+freez(&aliasTable);
+freez(&displayNameTable);
+freez(&dataType);
+freez(&platform);
+freez(&type);
+freez(&visibility);
+freez(&url);
+freez(&security);
+freez(&local_url);
+freez(&profile);
+freez(&wrangler);
+freez(&citation);
+freez(&article_title);
+freez(&author_list);
+freez(&wrangling_procedure);
+}
+
+struct raDb *raDbLoadWithNull(char **row)
+/* Load a raDb from row fetched with select * from raDb
+ * from database.  Dispose of this with raDbFree(). */
+{
+struct raDb *ret;
+
+AllocVar(ret);
+if (row[0] != NULL)
+    {
+    ret->id = needMem(sizeof(*(ret->id)));
+    *(ret->id) = sqlUnsigned(row[0]);
+    }
+else
+    {
+    ret->id = NULL;
+    }
+ret->name = cloneString(row[1]);
+ret->accessTable = cloneString(row[2]);
+ret->shortLabel = cloneString(row[3]);
+ret->longLabel = cloneString(row[4]);
+if (row[5] != NULL)
+    {
+    ret->expCount = needMem(sizeof(*(ret->expCount)));
+    *(ret->expCount) = sqlUnsigned(row[5]);
+    }
+else
+    {
+    ret->expCount = NULL;
+    }
+if (row[6] != NULL)
+    {
+    ret->height = needMem(sizeof(*(ret->height)));
+    *(ret->height) = sqlUnsigned(row[6]);
+    }
+else
+    {
+    ret->height = NULL;
+    }
+ret->groupName = cloneString(row[7]);
+ret->raFile = cloneString(row[8]);
+ret->patDb = cloneString(row[9]);
+ret->sampleField = cloneString(row[10]);
+ret->patTable = cloneString(row[11]);
+ret->patField = cloneString(row[12]);
+ret->aliasTable = cloneString(row[13]);
+ret->displayNameTable = cloneString(row[14]);
+ret->dataType = cloneString(row[15]);
+ret->platform = cloneString(row[16]);
+if (row[17] != NULL)
+    {
+    ret->expScale = needMem(sizeof(float));
+    *(ret->expScale) = sqlFloat(row[17]);
+    }
+if (row[18] != NULL)
+    {
+    ret->gainFull = needMem(sizeof(float));
+    *(ret->gainFull) = sqlFloat(row[18]);
+    }
+if (row[19] != NULL)
+    {
+    ret->gainSet = needMem(sizeof(float));
+    *(ret->gainSet) = sqlFloat(row[19]);
+    }
+ret->type = cloneString(row[20]);
+ret->visibility = cloneString(row[21]);
+if (row[22] != NULL)
+    {
+    ret->priority = needMem(sizeof(float));
+    *(ret->priority) = sqlFloat(row[22]);
+    }
+ret->url = cloneString(row[23]);
+ret->security = cloneString(row[24]);
+ret->local_url = cloneString(row[25]);
+ret->profile = cloneString(row[26]);
+ret->wrangler = cloneString(row[27]);
+ret->citation = cloneString(row[28]);
+ret->article_title = cloneString(row[29]);
+ret->author_list = cloneString(row[30]);
+ret->wrangling_procedure = cloneString(row[31]);
+return ret;
+}
+
+struct raDb *raDbLoadAll(char *fileName) 
+/* Load all raDb from a whitespace-separated file.
+ * Dispose of this with raDbFreeList(). */
+{
+struct raDb *list = NULL, *el;
+struct lineFile *lf = lineFileOpen(fileName, TRUE);
+char *row[32];
+
+while (lineFileRow(lf, row))
+    {
+    el = raDbLoadWithNull(row);
+    slAddHead(&list, el);
+    }
+lineFileClose(&lf);
+slReverse(&list);
+return list;
+}
+
+struct raDb *raDbLoadAllByChar(char *fileName, char chopper) 
+/* Load all raDb from a chopper separated file.
+ * Dispose of this with raDbFreeList(). */
+{
+struct raDb *list = NULL, *el;
+struct lineFile *lf = lineFileOpen(fileName, TRUE);
+char *row[32];
+
+while (lineFileNextCharRow(lf, chopper, row, ArraySize(row)))
+    {
+    el = raDbLoadWithNull(row);
+    slAddHead(&list, el);
+    }
+lineFileClose(&lf);
+slReverse(&list);
+return list;
+}
+
+struct raDb *raDbCommaIn(char **pS, struct raDb *ret)
+/* Create a raDb out of a comma separated string. 
+ * This will fill in ret if non-null, otherwise will
+ * return a new raDb */
+{
+char *s = *pS;
+
+if (ret == NULL)
+    AllocVar(ret);
+ret->id = needMem(sizeof(unsigned));
+*(ret->id) = sqlUnsignedComma(&s);
+ret->name = sqlStringComma(&s);
+ret->accessTable = sqlStringComma(&s);
+ret->shortLabel = sqlStringComma(&s);
+ret->longLabel = sqlStringComma(&s);
+ret->expCount = needMem(sizeof(unsigned));
+*(ret->expCount) = sqlUnsignedComma(&s);
+ret->height = needMem(sizeof(unsigned));
+*(ret->height) = sqlUnsignedComma(&s);
+ret->groupName = sqlStringComma(&s);
+ret->raFile = sqlStringComma(&s);
+ret->patDb = sqlStringComma(&s);
+ret->sampleField = sqlStringComma(&s);
+ret->patTable = sqlStringComma(&s);
+ret->patField = sqlStringComma(&s);
+ret->aliasTable = sqlStringComma(&s);
+ret->displayNameTable = sqlStringComma(&s);
+ret->dataType = sqlStringComma(&s);
+ret->platform = sqlStringComma(&s);
+ret->expScale = needMem(sizeof(*(ret->expScale)));
+*(ret->expScale) = sqlFloatComma(&s);
+ret->gainFull = needMem(sizeof(*(ret->gainFull)));
+*(ret->gainFull) = sqlFloatComma(&s);
+ret->gainSet = needMem(sizeof(*(ret->gainSet)));
+*(ret->gainSet) = sqlFloatComma(&s);
+ret->type = sqlStringComma(&s);
+ret->visibility = sqlStringComma(&s);
+ret->priority = needMem(sizeof(*(ret->priority)));
+*(ret->priority) = sqlFloatComma(&s);
+ret->url = sqlStringComma(&s);
+ret->security = sqlStringComma(&s);
+ret->local_url = sqlStringComma(&s);
+ret->profile = sqlStringComma(&s);
+ret->wrangler = sqlStringComma(&s);
+ret->citation = sqlStringComma(&s);
+ret->article_title = sqlStringComma(&s);
+ret->author_list = sqlStringComma(&s);
+ret->wrangling_procedure = sqlStringComma(&s);
+*pS = s;
+return ret;
+}
+
+void raDbFree(struct raDb **pEl)
+/* Free a single dynamically allocated raDb such as created
+ * with raDbLoad(). */
+{
+struct raDb *el;
+
+if ((el = *pEl) == NULL) return;
+freeMem(el->name);
+freeMem(el->accessTable);
+freeMem(el->shortLabel);
+freeMem(el->longLabel);
+freeMem(el->groupName);
+freeMem(el->raFile);
+freeMem(el->patDb);
+freeMem(el->sampleField);
+freeMem(el->patTable);
+freeMem(el->patField);
+freeMem(el->aliasTable);
+freeMem(el->displayNameTable);
+freeMem(el->dataType);
+freeMem(el->platform);
+freeMem(el->type);
+freeMem(el->visibility);
+freeMem(el->url);
+freeMem(el->security);
+freeMem(el->local_url);
+freeMem(el->profile);
+freeMem(el->wrangler);
+freeMem(el->citation);
+freeMem(el->article_title);
+freeMem(el->author_list);
+freeMem(el->wrangling_procedure);
+freez(pEl);
+}
+
+void raDbFreeList(struct raDb **pList)
+/* Free a list of dynamically allocated raDb's */
+{
+struct raDb *el, *next;
+
+for (el = *pList; el != NULL; el = next)
+    {
+    next = el->next;
+    raDbFree(&el);
+    }
+*pList = NULL;
+}
+
+void raDbOutput(struct raDb *el, FILE *f, char sep, char lastSep) 
+/* Print out raDb.  Separate fields with sep. Follow last field with lastSep. */
+{
+fprintf(f, "%u", *(el->id));
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->name);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->accessTable);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->shortLabel);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->longLabel);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+fprintf(f, "%u", *(el->expCount));
+fputc(sep,f);
+fprintf(f, "%u", *(el->height));
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->groupName);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->raFile);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->patDb);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->sampleField);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->patTable);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->patField);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->aliasTable);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->displayNameTable);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->dataType);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->platform);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+fprintf(f, "%g", *(el->expScale));
+fputc(sep,f);
+fprintf(f, "%g", *(el->gainFull));
+fputc(sep,f);
+fprintf(f, "%g", *(el->gainSet));
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->type);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->visibility);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+fprintf(f, "%g", *(el->priority));
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->url);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->security);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->local_url);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->profile);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->wrangler);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->citation);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->article_title);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->author_list);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->wrangling_procedure);
+if (sep == ',') fputc('"',f);
+fputc(lastSep,f);
+}
+
+void raDbJsonOutput(struct raDb *el, FILE *f) 
+/* Print out raDb in JSON format. */
+{
+fputc('{',f);
+fputc('"',f);
+fprintf(f,"id");
+fputc('"',f);
+fputc(':',f);
+fprintf(f, "%u", *(el->id));
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"name");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->name);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"accessTable");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->accessTable);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"shortLabel");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->shortLabel);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"longLabel");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->longLabel);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"expCount");
+fputc('"',f);
+fputc(':',f);
+fprintf(f, "%u", *(el->expCount));
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"height");
+fputc('"',f);
+fputc(':',f);
+fprintf(f, "%u", *(el->height));
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"groupName");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->groupName);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"raFile");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->raFile);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"patDb");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->patDb);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"sampleField");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->sampleField);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"patTable");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->patTable);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"patField");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->patField);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"aliasTable");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->aliasTable);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"displayNameTable");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->displayNameTable);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"dataType");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->dataType);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"platform");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->platform);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"expScale");
+fputc('"',f);
+fputc(':',f);
+fprintf(f, "%g", *(el->expScale));
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"gainFull");
+fputc('"',f);
+fputc(':',f);
+fprintf(f, "%g", *(el->gainFull));
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"gainSet");
+fputc('"',f);
+fputc(':',f);
+fprintf(f, "%g", *(el->gainSet));
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"type");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->type);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"visibility");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->visibility);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"priority");
+fputc('"',f);
+fputc(':',f);
+fprintf(f, "%g", *(el->priority));
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"url");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->url);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"security");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->security);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"local_url");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->local_url);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"profile");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->profile);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"wrangler");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->wrangler);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"citation");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->citation);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"article_title");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->article_title);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"author_list");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->author_list);
+fputc('"',f);
+fputc(',',f);
+fputc('"',f);
+fprintf(f,"wrangling_procedure");
+fputc('"',f);
+fputc(':',f);
+fputc('"',f);
+fprintf(f, "%s", el->wrangling_procedure);
+fputc('"',f);
+fputc('}',f);
+}
+
+/* -------------------------------- End autoSql Generated Code -------------------------------- */
+