Changeset 315 for trunk/docs


Ignore:
Timestamp:
Jan 6, 2007, 11:45:41 AM (13 years ago)
Author:
darcy
Message:

Allow keywords to be specified for insert, update and delete.
Document changes.
Add unit tests for changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/pg.txt

    r314 r315  
    841841Syntax::
    842842
    843   insert(table, a)
     843  insert(table, [d,] [key = val, ...])
    844844
    845845Parameters:
    846846  :table: name of table
    847   :a:     a dictionary of values
     847  :d:     optional dictionary of values
    848848
    849849Return type:
     
    855855  values from the database. This causes the dictionary to be updated
    856856  with values that are modified by rules, triggers, etc.
     857
     858  If the optional dictionary is not supplied then the required values
     859  must be included as keyword/value pairs.  If a dictionary is supplied
     860  then any keywords provided will be added to or replace the entry in
     861  the dictionary.
    857862
    858863  Due to the way that this function works you will find inserts taking
     
    866871Syntax::
    867872
    868   update(table, a)
     873  update(table, [d,] [key = val, ...])
    869874
    870875Parameters:
    871876  :table: name of table
    872   :a:     a dictionary of values
     877  :d:     optional dictionary of values
    873878
    874879Return type:
     
    881886  to triggers, rules, defaults, etc.
    882887
     888  Like insert, the dictionary is optional and updates will be performed
     889  on the fields in the keywords.  There must be an OID or primary key
     890  either in the dictionary where the OID must be munged, or in the keywords
     891  where it can be simply the string "oid".
     892
    883893clear - clears row values in memory
    884894-----------------------------------
     
    889899Parameters:
    890900  :table: name of table
    891   :a:     a dictionary of values
     901  :a:     optional dictionary of values
    892902
    893903Return type:
     
    901911  matching attribute names are cleared with everything else left unchanged.
    902912
     913  If the dictionary is not supplied a new one is created.
     914
    903915delete - delete a row from a database table
    904916-------------------------------------------
    905917Syntax::
    906918
    907   delete(table, [a])
     919  delete(table, [d,] [key = val, ...])
    908920
    909921Parameters:
    910922  :table: name of table
    911   :a:     a dictionary of values
     923  :d:     optional dictionary of values
    912924
    913925Returns:
     
    916928Description:
    917929  This method deletes the row from a table. It deletes based on the OID
    918   as munged as described above.
     930  as munged as described above.  Alternatively, the keyword "oid" can
     931  be used to specify the OID.
    919932
    920933escape_string - escape a string for use within SQL
Note: See TracChangeset for help on using the changeset viewer.