WIP NetDB (Database) Module: Need Feedback

About Monkey 2 Forums Monkey 2 Projects WIP NetDB (Database) Module: Need Feedback

This topic contains 3 replies, has 2 voices, and was last updated by  scurty 1 year, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8387

    scurty
    Participant

    Taking influence from PHP and using the amazingness of MX2 I’ve updated my previous WIP SQLite3 Abstraction Layer into using JSON instead of a Stack< StringMap< String > >

    Again still, the goal here is to execute very simple SQL Queries and get the Results from native MX2. (Now Using Json for the Return Values)

    The following Code Sample shows how it’s done as of now. (Subject to change due to possible future enhancements)

    The “netdb.monkey2” Module is Here, you should be able to just be plug and play into your projects.
    (Tested only on Windows 10 & Linux Kernel 4+)
    I wrote this with barely any documentation very quickly so forgive any memory leaks or flat-out wrong usage of the sqlite3 lib. x’D Please you’re welcome to suggest any improvements.

    Now you can use the Json Library for transmitting query results over TCP/UDP protocols, to kinda make your own storage server if you wish.

    Note: This Module doesn’t support arrays as database results just yet, A.K.A Blobs in SQLite3 “speak” I think.

    The next improvement should be arrays, and maybe better access to structured table return types. But that should be simple to implement yourself if needed.

    #8489

    Mark Sibly
    Keymaster

    Very nice!

    #8539

    scurty
    Participant

    Thanks Mark!

    Should I switch to JSON for the result Data instead of making the Alias?
    I feel like it would be more flexible since you can use GetString/GetNumber instead of type casting.

    Edit: The only issue I see with JSON is generating the results from the Database would probably require parsing the JSON from an assembled string, that might add too much overhead for response times. I’ll try and run a few tests. Update later.

    #8625

    scurty
    Participant

    Updated to JSON. Works great! Probably faster than my own parsing functions! I still have both versions. I’ll compare, but I’m very sure that JSON is quicker and more reliable. (Sorry for the double post)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.