Cubesql and json

  1. 3 months ago

    Sunil A

    May 31 Pre-Release Testers, Xojo Pro Kuwait

    In the cubesql documentation it says about json format communication but the example code is in php language. Can someone give an example code in xojo to connect to db and fetch some data.

  2. Kimball L

    May 31 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    Here's a basic example:

    dim db as New CubeSQLServer
    db.Host = "yourdatabasehost"
    db.Port = 4430 //whatever port your cubesql listens on
    db.UserName = "yourusername"
    db.Password = "yourpassword"
    
    if (db.Connect = false) then
      MsgBox "Connection failed: " + db.ErrorMessage + " (" + Str(db.ErrorCode) + ")"
      return
    end if
    
    //Once you are connected, you can query like this: 
    
    dim rs as RecordSet = db.sqlSelect("your sql query here")
    //deal with results, etc.
  3. Sunil A

    May 31 Pre-Release Testers, Xojo Pro Kuwait

    No not this. This is the usual method using cubesql plugin. I need to know the way using rest api with json format.

  4. Norman P

    May 31 Pre-Release Testers, Xojo Pro great-white-software.com/blog

    considering they wrote on the blog

    actually it is just a php class with about 100 lines of code

    it sounds like this is specific to php

  5. Sunil A

    May 31 Pre-Release Testers, Xojo Pro Kuwait

    Wont that work using xojo code. I will check with cubesql aswell

  6. Johnny H

    May 31 Pre-Release Testers United States - Arkansas

    In order to try to supports as much heterogeneous clients as possible cubeSQL fully
    supports the JSON open standard protocol. JSON is a lightwave text based protocol and
    is built-into any major language (like PHP, Ruby, LiveCode and so on). In this version only
    JSON over TCP/IP is supported, next version will also support JSON over HTTP.
    For a complete and working JSON implementation we strongly suggest you to take a
    look at the cubeSQLServer.php class.

    Cubesql JSON protocol

  7. Ivan T

    May 31 Pre-Release Testers
    Edited 3 months ago

    http://docs.xojo.com/UserGuide:TCP/IP_Communication

    http://docs.xojo.com/UserGuide:JSON

  8. Oliver O

    Jun 1 Pre-Release Testers, Xojo Pro https://udemy.seminar.pro

    https://github.com/cubesql/sdk/tree/master/PHP

  9. Dean D

    Jun 4 Pre-Release Testers, Xojo Pro Santa Ynez California

    The SQLite docs should apply to CubeSQL as well
    https://www.sqlite.org/draft/json1.html

  10. Ivan T

    Jun 4 Pre-Release Testers

    @Dean D The SQLite docs should apply to CubeSQL as well
    https://www.sqlite.org/draft/json1.html

    He is asking about the json communication with the CubeSQL server, not about an Extension of the SQLite

  11. Sunil A

    Jun 4 Pre-Release Testers, Xojo Pro Kuwait

    In the cubesql documentation it says about json communication over tcp / http. I tried the tcp method and was not able to connect because of invalid credential error. I believe its because of sha1 cripto issue in xojo. For the http method cubesql is not even accepting the communication. I have send a mail to cubesql and haven't got a reply yet. Anyone can try this as cubesql is free for 2 users.

  12. Alberto D

    Jun 4 Pre-Release Testers
    Edited 3 months ago

    From:
    https://www.sqlabs.com/download/cubesql/manuals/CubeSQL%20JSON%20protocol.pdf

    In this version only JSON over TCP/IP is supported, next version will also support JSON over HTTP.

    I don't know if the next version is out yet.

  13. Sunil A

    Jun 4 Pre-Release Testers, Xojo Pro Kuwait

    You can see that document was created in 2011. So i imagine after that several new versions were introduced.

  14. Alberto D

    Jun 5 Pre-Release Testers
    Edited 3 months ago

    I can't find anything about 2011, this is what the PDF show on the first page:

    © 2005-2019 SQLabs, All rights reserved.

    I don't know much about CubeSQL but I think the logo was updated recently and the new one is shown on that PDF.

    Anyway, if JSON works now with HTTP, then you can use it (I guess). Good luck.

or Sign Up to reply!