-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benoit T.
committed
Apr 25, 2024
1 parent
7c90ce5
commit e7fd72c
Showing
3 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# needed R packages for DB connection. Use comma separation for multiple dependencies like [package1, package2] | ||
r_packages: [RMariaDB] | ||
|
||
# connection using DBI Interface | ||
# Possible to use !expr Sys.getenv(`NAME_ENV_VAR`) | ||
# all args to be passed to DBI::dbConnect | ||
connect: | ||
drv: !expr RMariaDB::MariaDB() | ||
host: "localhost" | ||
user: "user" | ||
password: "********" | ||
db : "dbname" | ||
|
||
tables: | ||
credentials: | ||
tablename: credentials # if you want to change tablename | ||
# user, password, start, expire, admin = mandatory with this name | ||
# after you can add optionnal custom columns next, getting back in server.R and admin interface | ||
init: CREATE TABLE {`tablename`} ( | ||
`user` varchar(100) PRIMARY KEY, | ||
`password` varchar(256), | ||
`start` date, | ||
`expire` date, | ||
`admin` boolean | ||
|
||
) | ||
# Keep same {glue_name*}, update request only if needed. | ||
select: SELECT * FROM {`tablename`} WHERE `user` IN ({user*}) | ||
update: UPDATE {`tablename`} SET {`name`} = {value} WHERE `user` IN ({udpate_users*}) | ||
delete: DELETE FROM {`tablename`} WHERE `user` IN ({del_users*}) | ||
pwd_mngt: | ||
tablename: pwd_mngt # if you want to change tablename | ||
# user, must_change, have_changed, date_change, n_wrong_pwd = mandatory with this name | ||
# No additionnal columns here | ||
init: CREATE TABLE {`tablename`} ( | ||
`user` varchar(100) PRIMARY KEY, | ||
`must_change` boolean, | ||
`have_changed` boolean, | ||
`date_change` date, | ||
`n_wrong_pwd` smallint | ||
) | ||
# Keep same {glue_name*}, update request only if needed. | ||
select: SELECT * FROM {`tablename`} WHERE `user` IN ({user*}) | ||
update: UPDATE {`tablename`} SET {`name`} = {value} WHERE `user` IN ({udpate_users*}) | ||
delete: DELETE FROM {`tablename`} WHERE `user` IN ({del_users*}) | ||
logs: | ||
tablename: logs # if you want to change tablename | ||
# all = mandatory with this name | ||
# No additionnal columns here | ||
init: CREATE TABLE {`tablename`} ( | ||
`id` SERIAL PRIMARY KEY, | ||
`user` varchar(100), | ||
`server_connected` timestamp, | ||
`token` varchar(100), | ||
`logout` timestamp, | ||
`status` varchar(100), | ||
`app` varchar(100) | ||
) | ||
# Keep same {glue_name*}, update request only if needed. | ||
check_token : SELECT * FROM {`tablename`} WHERE `token` IN ({token*}) | ||
select: SELECT * FROM {`tablename`} WHERE `user` IN ({user*}) AND `server_connected` >= {`date_h_begin`} AND `server_connected` <= {`date_h_end`} | ||
update: UPDATE {`tablename`} SET {`name`} = {value} WHERE `token` IN ({token*}) |