Changeset 30507 in project


Ignore:
Timestamp:
02/26/14 00:52:21 (7 years ago)
Author:
Mario Domenech Goulart
Message:

awful (wiki): update documentation for version 0.41.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/awful

    r30483 r30507  
    15301530
    15311531===== {{$db}}
    1532 <procedure>($db q #!key default values)</procedure>
     1532<procedure>($db q #!key (default '()) values)</procedure>
    15331533
    15341534Execute the given query ({{q}}) on the database and return the result
     
    15431543($db "insert into foo (bar, baz) values (?, ?)" values: '("bar-val" "baz-val"))
    15441544</enscript>
     1545
     1546''Note'': up to version 0.40.0, {{$db}} returned {{#f}} when queries
     1547returned empty set of results.  Starting from version 0.41.0, {{$db}}
     1548returns {{'()}} queries return empty set of results.
    15451549
    15461550If you use the [[/egg/awful-ssql|awful-ssql]] egg, you can give
     
    15721576[[/egg/awful-ssql|awful-ssql]] for more details.  Support for SSQL has
    15731577been introduced in awful version 0.40.0.
    1574 
    1575 ===== {{sql-quote}}
    1576 <procedure>(sql-quote . data)</procedure>
    1577 
    1578 ''Warning'': this procedure is deprecated and will be removed in
    1579 future awful versions.
    1580 
    1581 Escape and quote the concatenation of {{data}} to be used in SQL queries.
    1582 
    1583 ''Warning'': for SQLite databases, {{sql-quote}} just replaces {{'}}
    1584 by {{''}} and quotes the {{data}}.  For PostgreSQL, {{sql-quote}}
    1585 quotes the result of {{escape-string}}.
    1586 
    1587 Consider using the API for placeholders of your favorite database egg
    1588 instead of {{sql-quote}} whenever possible.
    15891578
    15901579
     
    31773166=== Version history
    31783167
    3179 ===== version 0.40.0
     3168===== version 0.41.0
     3169
     3170* The deprecated procedure {{sql-quote}} has been removed
     3171
     3172* Set the default value for {{$db}}'s {{default}} keyword param as {{'()}}
     3173
     3174To be consistent with the db-support eggs for awful.
     3175
     3176'''WARNING''': this change may break your code!  In case of an empty
     3177result set from a query, {{$db}} will now return {{'()}} instead of
     3178{{#f}}.
     3179
     3180This change can be specially harmful in case you have something like
     3181
     3182<enscript highlight=scheme>
     3183         (or ($db "some query") "something")
     3184</enscript>
     3185
     3186In this example, if the query returns an empty result set, that
     3187expression would produce:
     3188
     3189* in older awful versions: {{"something"}}
     3190* in awful versions with this change: {{'()}}
     3191
     3192To work around the incompatible behaviors, you can:
     3193
     3194* require awful 0.41.0 in you .meta file
     3195* always provide a value for {{$db}}'s {{default}} keyword parameter
     3196
     3197
     3198===== [[http://wiki.call-cc.org/eggref/4/awful?action=show&rev=30483|version 0.40.0]]
    31803199* SSQL support for {{$db}} and {{$db-row-obj}}
    31813200* Full support for static pages generation (via [[/egg/awful-static-pages|awful-static-pages]])
Note: See TracChangeset for help on using the changeset viewer.