Changes between Version 1 and Version 2 of SqlConstantsPlugin
- Timestamp:
- Jun 11, 2015, 7:31:41 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SqlConstantsPlugin
v1 v2 1 = SQL Constants = 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 == Description == 3 = Maintain list of static data as key-value pairs in SQL 4 5 == Description 4 6 5 7 This 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. 6 8 7 == Bugs/Feature Requests ==9 == Bugs/Feature Requests 8 10 9 11 Existing bugs and feature requests for SqlConstantsPlugin are … … 11 13 12 14 If you have any issues, create a 13 [ http://trac-hacks.org/newticket?component=SqlConstantsPlugin&owner=optiludenew ticket].15 [/newticket?component=SqlConstantsPlugin new ticket]. 14 16 15 == Download == 17 [[TicketQuery(component=SqlConstantsPlugin,group=type,format=progress)]] 18 19 == Download 16 20 17 21 Download the zipped source from [download:sqlconstantsplugin here]. 18 22 19 == Source ==23 == Source 20 24 21 25 You can check out SqlConstantsPlugin from [http://trac-hacks.org/svn/sqlconstantsplugin here] using Subversion, or [source:sqlconstantsplugin browse the source] with Trac. 22 26 23 == Example ==27 == Example 24 28 25 Simply install the plugin as normal, and add a table like this to the database:29 Install the plugin as normal, and add a table like this to the database: 26 30 27 {{{ 28 29 `constant` varchar(255) NOT NULL,30 `stringval` varchar(255) DEFAULT NULL,31 `intval` int(11) DEFAULT NULL,32 `floatval` floatDEFAULT NULL,33 34 31 {{{#!sql 32 CREATE 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 ); 35 39 }}} 36 40 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).41 You 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. 38 42 39 43 Visit the administration panel to update constants. 40 44 41 == Recent Changes ==45 == Recent Changes 42 46 43 47 [[ChangeLog(sqlconstantsplugin, 3)]] 44 48 45 == Author/Contributors ==49 == Author/Contributors 46 50 47 51 '''Author:''' [wiki:optilude] [[BR]] 52 '''Maintainer:''' [[Maintainer]] [[BR]] 48 53 '''Contributors:'''