JSON based dataset lazarus / 16-Databases ---------------------------------------------------------------------- Blestan · 2012-06-28 09:19 Hi! Here can i find the source for a json based dataset ... i found some posts in the forum but did not find any link to source... thanks! ---------------------------------------------------------------------- goodname · 2012-06-28 13:27 The lazarus install folder contains json sample project files to parse and write json strings. Just do a file name search for json to find them. ---------------------------------------------------------------------- Blestan · 2012-06-28 14:53 I know how to use raw json ... my question was about a TDATASET descendant that uses a json as data store ---------------------------------------------------------------------- Leledumbo · 2012-06-28 15:12 None exist AFAIK, don't know about 3rd party, probably commercial components out there though. fpdbexport can export TDataSet as JSON, but that's the best I can find. ---------------------------------------------------------------------- goodname · 2012-06-28 15:54 If a database makes sense in your project then PostgreSQL 9.2 will have native json support. The json data would be read and written using SQL queries. PostgreSQL currently has something called hstore which is a key value storage. ---------------------------------------------------------------------- marcov · 2012-06-28 18:31 Quote from: Leledumbo on June 28, 2012, 05:12:30 pmNone exist AFAIK, don't know about 3rd party, probably commercial components out there though. fpdbexport can export TDataSet as JSON, but that's the best I can find. Personally I would try to do something with the file fpc/packages/fcl- db/src/json/fpjsondataset.pp It's only in SVN versions atm btw, not in 2.6.0 (both recent 2.6.1 and 2.7.1's) ---------------------------------------------------------------------- snorkel · 2012-06-28 18:48 Check out the JSON – SuperObject http://www.progdigy.com/?page_id=6 Doesn't have a tdataset object, but it's not hard to write a little helper function using a SuperObject array to convert a tdataset to json. ---------------------------------------------------------------------- BigChimp · 2012-06-28 18:52 @snorkel: Would that json superobject be better than the existing jsondataset + FPC json units? ---------------------------------------------------------------------- Blestan · 2012-06-28 19:01 may be i did not explain myself very good ... my idea is to use json AS a dataset e.g bind visual controls to json data ... to display,scroll edit ... and build a delta and send it bqck to the server to update the database ---------------------------------------------------------------------- BigChimp · 2012-06-28 19:06 Quote from: marcov on June 28, 2012, 08:31:55 pmPersonally I would try to do something with the file fpc/packages/fcl- db/src/json/fpjsondataset.pp It's only in SVN versions atm btw, not in 2.6.0 (both recent 2.6.1 and 2.7.1's) Well, it is called a dataset in the name... The contents have this: Code: [Select]TBaseJSONDataSet = class (TDataSet)... so that seems like a dataset to me. Have never used it, but it can't hurt to try with that one, I'd think... ---------------------------------------------------------------------- Blestan · 2012-06-28 19:44 Good!!! How i can get the source just for this file from svn? ---------------------------------------------------------------------- marcov · 2012-06-28 19:55 Quote from: Blestan on June 28, 2012, 09:44:08 pmGood!!! How i can get the source just for this file from svn? For development sources, see the development page of the freepascal website: http://www.freepascal.org/develop.var ---------------------------------------------------------------------- BigChimp · 2012-06-28 19:57 Hint: there is a web interface to the svn server... If you have to ask how to do that, I would suggest to simply download fpcup and run it; you'll get fpc 2.6.1+Lazarus trunk in a separate c:\development\ directory+subdirectories As long as your existing fpc&Lazarus are not in c:\development or below, they will not be disturbed. ---------------------------------------------------------------------- Leledumbo · 2012-06-28 23:41 QuotePersonally I would try to do something with the file fpc/packages/fcl-db/src/json/fpjsondataset.ppWhoops, I should have looked deeper