Recent

Author Topic: JSON based dataset  (Read 15334 times)

Blestan

  • Sr. Member
  • ****
  • Posts: 461
JSON based dataset
« on: June 28, 2012, 11:19:53 am »
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!
Speak postscript or die!
Translate to pdf and live!

goodname

  • Sr. Member
  • ****
  • Posts: 297
Re: JSON based dataset
« Reply #1 on: June 28, 2012, 03:27:58 pm »
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

  • Sr. Member
  • ****
  • Posts: 461
Re: JSON based dataset
« Reply #2 on: June 28, 2012, 04:53:03 pm »
:) I know how to use raw json ... my question was about a TDATASET descendant that uses a json as data store
Speak postscript or die!
Translate to pdf and live!

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: JSON based dataset
« Reply #3 on: June 28, 2012, 05:12:30 pm »
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

  • Sr. Member
  • ****
  • Posts: 297
Re: JSON based dataset
« Reply #4 on: June 28, 2012, 05:54:27 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 12634
  • FPC developer.
Re: JSON based dataset
« Reply #5 on: June 28, 2012, 08:31:55 pm »
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.

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

  • Hero Member
  • *****
  • Posts: 817
Re: JSON based dataset
« Reply #6 on: June 28, 2012, 08:48:39 pm »
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.

 
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: JSON based dataset
« Reply #7 on: June 28, 2012, 08:52:53 pm »
@snorkel: Would that json superobject be better than the existing jsondataset + FPC json units?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: JSON based dataset
« Reply #8 on: June 28, 2012, 09:01:58 pm »
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
Speak postscript or die!
Translate to pdf and live!

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: JSON based dataset
« Reply #9 on: June 28, 2012, 09:06:52 pm »
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)
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...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: JSON based dataset
« Reply #10 on: June 28, 2012, 09:44:08 pm »
Good!!! How i can get the source just for this file from svn?
Speak postscript or die!
Translate to pdf and live!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12634
  • FPC developer.
Re: JSON based dataset
« Reply #11 on: June 28, 2012, 09:55:46 pm »
Good!!! 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

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: JSON based dataset
« Reply #12 on: June 28, 2012, 09:57:03 pm »
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.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: JSON based dataset
« Reply #13 on: June 29, 2012, 01:41:51 am »
Quote
Personally I would try to do something with the file fpc/packages/fcl-db/src/json/fpjsondataset.pp
Whoops, I should have looked deeper :-[

 

TinyPortal © 2005-2018