{"action":"created","issue":{"url":"https://api.github.com/repos/dividuum/info-beamer-nodes/issues/3","repository_url":"https://api.github.com/repos/dividuum/info-beamer-nodes","labels_url":"https://api.github.com/repos/dividuum/info-beamer-nodes/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/dividuum/info-beamer-nodes/issues/3/comments","events_url":"https://api.github.com/repos/dividuum/info-beamer-nodes/issues/3/events","html_url":"https://github.com/dividuum/info-beamer-nodes/issues/3","id":177565825,"number":3,"title":"Database connection Sqlite3","user":{"login":"RajshekharHoratti","id":21081661,"avatar_url":"https://avatars.githubusercontent.com/u/21081661?v=3","gravatar_id":"","url":"https://api.github.com/users/RajshekharHoratti","html_url":"https://github.com/RajshekharHoratti","followers_url":"https://api.github.com/users/RajshekharHoratti/followers","following_url":"https://api.github.com/users/RajshekharHoratti/following{/other_user}","gists_url":"https://api.github.com/users/RajshekharHoratti/gists{/gist_id}","starred_url":"https://api.github.com/users/RajshekharHoratti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RajshekharHoratti/subscriptions","organizations_url":"https://api.github.com/users/RajshekharHoratti/orgs","repos_url":"https://api.github.com/users/RajshekharHoratti/repos","events_url":"https://api.github.com/users/RajshekharHoratti/events{/privacy}","received_events_url":"https://api.github.com/users/RajshekharHoratti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-17T09:20:13Z","updated_at":"2016-09-23T22:10:55Z","closed_at":null,"body":"We are trying to play a video files, where in the names are stored in sqlite database.\r\n\r\nTried connecting to sqlite db from node.lua but throws 'a nil value' ran into all sorts of errors. Whilst the same works on command line lua interpreter.  \r\n\r\nIs there any sample snippets where info-beamer can connect to sqite db.\r\n\r\nKindly help."},"comment":{"url":"https://api.github.com/repos/dividuum/info-beamer-nodes/issues/comments/249314409","html_url":"https://github.com/dividuum/info-beamer-nodes/issues/3#issuecomment-249314409","issue_url":"https://api.github.com/repos/dividuum/info-beamer-nodes/issues/3","id":249314409,"user":{"login":"dividuum","id":214550,"avatar_url":"https://avatars.githubusercontent.com/u/214550?v=3","gravatar_id":"","url":"https://api.github.com/users/dividuum","html_url":"https://github.com/dividuum","followers_url":"https://api.github.com/users/dividuum/followers","following_url":"https://api.github.com/users/dividuum/following{/other_user}","gists_url":"https://api.github.com/users/dividuum/gists{/gist_id}","starred_url":"https://api.github.com/users/dividuum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dividuum/subscriptions","organizations_url":"https://api.github.com/users/dividuum/orgs","repos_url":"https://api.github.com/users/dividuum/repos","events_url":"https://api.github.com/users/dividuum/events{/privacy}","received_events_url":"https://api.github.com/users/dividuum/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T22:10:55Z","updated_at":"2016-09-23T22:10:55Z","body":"You have to store the result of calling `Test` somewhere: I'd suggest you use this approach:\r\n\r\n```\r\nlocal videos = {}\r\n\r\nnode.event(\"content_update\", function(filename)\r\n    if filename == \"data.json\" then\r\n        local data = json.decode(resource.load_file(filename))\r\n        videos = {} -- reset the table, so it can be filled again\r\n        for _, v in ipairs(datadecode) do\r\n            videos[v.VideoID] = Video(v.file)\r\n        end\r\n    end\r\nend)\r\n\r\nlocal function Video(file)\r\n     -- the body of the Test function in your comment\r\nend\r\n```\r\n\r\nIn the UDP handler you can the access the Video \"object\" for each video by its `VideoID` like this:\r\n\r\n```\r\nlocal video = videos[VideoId]\r\n-- do something with the video here\r\n```\r\n\r\n"}}
{"actor":{"display_login":"dividuum"}}