IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 5, 2006, 2:16:35 PM (21 years ago)
Author:
jhoblitt
Message:

split global and per table data
forward port generated code to pslib 0.9.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/glueforge/templates/psdb/createtable.tt

    r4341 r5907  
    1 bool [% namespace %]CreateTable(psDB *dbh)
     1bool [% table.namespace %]CreateTable(psDB *dbh)
    22{
    33    psMetadata          *md;
     
    55
    66    md = psMetadataAlloc();
    7     psMetadataAdd(md, PS_LIST_TAIL, [% namespace FILTER upper %]_INDEX_NAME, PS_META_S32, "AUTO_INCREMENT", 0.0);
    8 [% FOREACH item = columns -%]
     7    psMetadataAdd(md, PS_LIST_TAIL, [% table.namespace FILTER upper %]_INDEX_NAME, PS_DATA_S32, "AUTO_INCREMENT", 0.0);
     8[% FOREACH item = table.columns -%]
    99[% IF item.comment;
    1010    SET item.comment = "\"$item.comment\"";
     
    1414-%]
    1515[% IF item.type == "S32" or item.type == "F32" or item.type == "F64" -%]
    16     if (!psMetadataAdd[% item.type %](md, PS_LIST_TAIL, "[% item.name %]", [% item.comment %], [% item.value %])) {
     16    if (!psMetadataAdd[% item.type %](md, PS_LIST_TAIL, "[% item.name %]", 0, [% item.comment %], [% item.value %])) {
    1717[% ELSIF item.type == "STR" -%]
    18     if (!psMetadataAddStr(md, PS_LIST_TAIL, "[% item.name %]", [% item.comment %], "[% item.value %]")) {
     18    if (!psMetadataAddStr(md, PS_LIST_TAIL, "[% item.name %]", 0, [% item.comment %], "[% item.value %]")) {
    1919[% ELSIF item.type == "BOOL" -%]
    2020[% IF item.value == 1;
     
    2424END;
    2525-%]
    26     if (!psMetadataAdd(md, PS_LIST_TAIL, "[% item.name %]", PS_META_BOOL, [% item.comment %], [% item.value %])) {
     26    if (!psMetadataAdd(md, PS_LIST_TAIL, "[% item.name %]", PS_DATA_BOOL, [% item.comment %], [% item.value %])) {
    2727[% END -%]
    2828        psError(PS_ERR_UNKNOWN, false, "failed to add item [% item.name %]");
     
    3232[% END -%]
    3333
    34     status = psDBCreateTable(dbh, [% namespace FILTER upper %]_TABLE_NAME, md);
     34    status = psDBCreateTable(dbh, [% table.namespace FILTER upper %]_TABLE_NAME, md);
    3535
    3636    psFree(md);
Note: See TracChangeset for help on using the changeset viewer.