{"id":19011469,"url":"https://github.com/perrywerneck/libudjatdb","last_synced_at":"2026-04-25T02:30:17.383Z","repository":{"id":219354499,"uuid":"722794640","full_name":"PerryWerneck/libudjatdb","owner":"PerryWerneck","description":"Udjat module to interact with databases using cppdb or sqlite as backend","archived":false,"fork":false,"pushed_at":"2025-02-04T04:48:35.000Z","size":204,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T05:26:43.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PerryWerneck.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-24T01:11:39.000Z","updated_at":"2024-11-07T01:38:42.000Z","dependencies_parsed_at":"2024-02-20T05:24:10.489Z","dependency_job_id":"02c62f85-4cae-4dbd-9284-5cd21ea9e05d","html_url":"https://github.com/PerryWerneck/libudjatdb","commit_stats":null,"previous_names":["perrywerneck/udjat-module-cppdb","perrywerneck/udjat-module-database","perrywerneck/libudjatdb"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Flibudjatdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Flibudjatdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Flibudjatdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Flibudjatdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PerryWerneck","download_url":"https://codeload.github.com/PerryWerneck/libudjatdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240042805,"owners_count":19738956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T19:14:25.669Z","updated_at":"2026-04-25T02:30:17.308Z","avatar_url":"https://github.com/PerryWerneck.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Database module for udjat\n\nDatabase module for udjat using cppdb or sqlite as backend.\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n![CodeQL](https://github.com/PerryWerneck/udjat-module-database/workflows/CodeQL/badge.svg?branch=master)\n[![build result](https://build.opensuse.org/projects/home:PerryWerneck:udjat/packages/udjat-module-database/badge.svg?type=percent)](https://build.opensuse.org/package/show/home:PerryWerneck:udjat/udjat-module-database)\n\n## Using module\n\n### Examples\n\n[Udjat](../../../udjat) service configuration to store an [user module](../../../udjat-module-users) alert on sqlite database:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\u003cconfig log-debug='yes' log-trace='yes'\u003e\n\n\t\u003c!-- The HTTP module implements the http client backend --\u003e\n\t\u003cmodule name='http' required='yes' /\u003e\n\t\n\t\u003c!-- Implements user's monitor --\u003e\n\t\u003cmodule name='users' required='yes' /\u003e\n\t\n\t\u003c!-- Load SQLite module --\u003e\n\t\u003cmodule name='sqlite' required='yes' /\u003e\t\n\n\t\u003c!-- SQLite database --\u003e\n\t\u003cattribute name='sqlite-file' value='/tmp/alerts.db' /\u003e\n\t\n\t\u003c!-- Special type of SQL Agent keeping a queue of URLs --\u003e\n\t\u003cagent type='sql' name='alerts' url-queue-name='sql' update-timer='60' \u003e\n\t\n\t\t\u003cattribute name='summary' value='Alerts on queue' /\u003e\n\t\t\u003cattribute name='label' value='Alert queue' /\u003e\n\t\n\t\t\u003c!-- Initialize an URL queue --\u003e\n\t\t\u003cinit\u003e\n\t\t\tcreate table if not exists alerts (id integer primary key, inserted timestamp default CURRENT_TIMESTAMP, url text, action text, payload text)\n\t\t\u003c/init\u003e\n\t\t\n\t\t\u003c!-- Get agent value --\u003e\n\t\t\u003crefresh\u003e\n\t\t\tselect count (*) as value from alerts\n\t\t\u003c/refresh\u003e\n\n\t\t\u003c!-- Store URL on database --\u003e\n\t\t\u003cinsert\u003e\n\t\t\tinsert into alerts (url,action,payload) values (${url},${action},${payload})\n\t\t\u003c/insert\u003e\n\n\t\t\u003c!-- Get data to send --\u003e\n\t\t\u003csend\u003e\n\t\t\tselect id,url,action,payload from alerts limit 1\n\t\t\u003c/send\u003e\n\t\t\n\t\t\u003c!-- Delete ID after sending it --\u003e\n\t\t\u003cafter-send\u003e\n\t\t\tdelete from alerts where id=${id}\n\t\t\u003c/after-send\u003e\n\t\n\t\u003c/agent\u003e\n\t\n\t\u003c!-- Declare an user monitor agent --\u003e\n\t\u003cagent type='users' name='users' update-timer='60'\u003e\n\n\t\t\u003c!-- The URL is prefixed with 'sql+' to be stored on database --\u003e\n\t\t\u003calert name='logout' event='logout' max-retries='1' action='post' url='sql+http://localhost'\u003e\n\t\t\t{\"user\":\"${username}\",\"macaddress\":\"${macaddress}\"}\n\t\t\u003c/alert\u003e\n\n\t\u003c/users\u003e\n\n\t\u003c!-- Declare an API call to get pending alerts --\u003e\n\t\u003capi-call type='sql' name='pending' action='get' response-type='table'\u003e\n\t\tselect * from alerts\n\t\u003c/api-call\u003e\n\t\n\u003c/config\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrywerneck%2Flibudjatdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperrywerneck%2Flibudjatdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrywerneck%2Flibudjatdb/lists"}