Results 1 to 3 of 3

Thread: Databases Queries and NR

  1. #1
    Join Date
    May 2004
    Dallas, TX

    Default Databases Queries and NR

    Now that Girder supports SQLite, if I query a database what is the best way to deliver that information to NR.

    Example: Query returns 25 rows
    Field 1, Field 2, Field 3, Field 4, etc...

    Would I just put the returned data into a table, pickle it up and send it to a NR variable?

    Or is there a better way?

    Girder 6.0 - Elk M1 Gold - JRMC 11.1 w/ M-Audio Delta 410 - NetRemote - BlueIris DVR
    Girder 6 Plugins - Elk M1/EZ8, Pushover Connector and more on the way.

    Visit My Showcase

  2. #2
    Join Date
    May 2004
    Cardigan, UK


    There are a number of functions in the NetRemote table that can be used to send a table to NR.

    If you want the table to be copied across to NR's Lua variable space you can use NetRemote.SetVariable(basename, tableValue) which will copy the table across and update an NR variable called basename .. '.changed'. You can use NetRemote.RegisterVariableWatch() on this NR variable to monitor changes to the table.

    If, on the other hand, you want the values in the table to be sent to NetRemote variables then you can use SendStemmedTable(baseLabel, aTable) which will iterate over the key, value pairs in the table and send the value to variables constructed from baseLabel .. '_' .. key. This will work for nested tables.

    There's also SendMappedTable, but that's a more complex function that is more suited to the situation where you need to match the names in the table to differently named NR variables. This is probably overly complicated for this case.

  3. #3
    Join Date
    Mar 2008


    Did you ever try this out? I am looking at doing something like this for a recipe database. I was wondering if maybe you could post a little code to show how you did it. I already know sql and i can read the data from the table i just want to be able to display it in nr2. Thanks for any help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts