Changes between Version 1 and Version 2 of SqlConstantsPlugin


Ignore:
Timestamp:
Jun 11, 2015, 7:31:41 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, tagged with license

Legend:

Unmodified
Added
Removed
Modified
  • SqlConstantsPlugin

    v1 v2  
    1 = SQL Constants =
     1[[PageOutline(2-5,Contents,pullout)]]
    22
    3 == Description ==
     3= Maintain list of static data as key-value pairs in SQL
     4
     5== Description
    46
    57This plugin adds a new administration control panel that can be used to manage constants (key/value pairs) stored in the database. These can then be used in report queries.
    68
    7 == Bugs/Feature Requests ==
     9== Bugs/Feature Requests
    810
    911Existing bugs and feature requests for SqlConstantsPlugin are
     
    1113
    1214If you have any issues, create a
    13 [http://trac-hacks.org/newticket?component=SqlConstantsPlugin&owner=optilude new ticket].
     15[/newticket?component=SqlConstantsPlugin new ticket].
    1416
    15 == Download ==
     17[[TicketQuery(component=SqlConstantsPlugin,group=type,format=progress)]]
     18
     19== Download
    1620
    1721Download the zipped source from [download:sqlconstantsplugin here].
    1822
    19 == Source ==
     23== Source
    2024
    2125You can check out SqlConstantsPlugin from [http://trac-hacks.org/svn/sqlconstantsplugin here] using Subversion, or [source:sqlconstantsplugin browse the source] with Trac.
    2226
    23 == Example ==
     27== Example
    2428
    25 Simply install the plugin as normal, and add a table like this to the database:
     29Install the plugin as normal, and add a table like this to the database:
    2630
    27 {{{
    28         CREATE TABLE `constants` (
    29           `constant` varchar(255) NOT NULL,
    30           `stringval` varchar(255) DEFAULT NULL,
    31           `intval` int(11) DEFAULT NULL,
    32           `floatval` float DEFAULT NULL,
    33           PRIMARY KEY (`constant`)
    34         );
     31{{{#!sql
     32CREATE TABLE `constants` (
     33  `constant` VARCHAR(255) NOT NULL,
     34  `stringval` VARCHAR(255) DEFAULT NULL,
     35  `intval` INT(11) DEFAULT NULL,
     36  `floatval` FLOAT DEFAULT NULL,
     37  PRIMARY KEY (`constant`)
     38);
    3539}}}
    3640
    37 You can then use this in report queries. The stringval column will always be stored. intval and floatval will contain the int/float equivalent if possible (i.e. the input could be cast to an int).
     41You can then use this in report queries. The `stringval` column will always be stored. Also, `intval` and `floatval` will contain the int/float equivalent if possible, ie the input could be cast to an INT.
    3842
    3943Visit the administration panel to update constants.
    4044
    41 == Recent Changes ==
     45== Recent Changes
    4246
    4347[[ChangeLog(sqlconstantsplugin, 3)]]
    4448
    45 == Author/Contributors ==
     49== Author/Contributors
    4650
    4751'''Author:''' [wiki:optilude] [[BR]]
     52'''Maintainer:''' [[Maintainer]] [[BR]]
    4853'''Contributors:'''