Skip to content

Commit cd4cfc9

Browse files
committed
Add SQLite3 default database
1 parent 914f426 commit cd4cfc9

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

data/motion-dist.conf.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ webcontrol_parms 2
9393
stream_preview_scale 100
9494
stream_preview_method combined
9595

96+
;*************************************************
97+
;***** Database
98+
;*************************************************
99+
database_type sqlite3
100+
database_dbname @localstatedir@/lib/@PACKAGE_NAME@/motion.db
101+
database_host localhost
102+
database_port 0
103+
database_user
104+
database_password
105+
database_busy_timeout 0
106+
96107
;*************************************************
97108
; Device config files - One for each device.
98109
;*************************************************

src/conf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,7 +2771,7 @@ void cls_config::edit_stream_scan_scale(std::string &parm, enum PARM_ACT pact)
27712771
void cls_config::edit_database_type(std::string &parm, enum PARM_ACT pact)
27722772
{
27732773
if (pact == PARM_ACT_DFLT) {
2774-
database_type = "";
2774+
database_type = "sqlite3";
27752775
} else if (pact == PARM_ACT_SET) {
27762776
if ((parm == "mariadb") || (parm == "") ||
27772777
(parm == "postgresql") || (parm == "sqlite3")) {
@@ -2793,7 +2793,7 @@ void cls_config::edit_database_type(std::string &parm, enum PARM_ACT pact)
27932793
void cls_config::edit_database_dbname(std::string &parm, enum PARM_ACT pact)
27942794
{
27952795
if (pact == PARM_ACT_DFLT) {
2796-
database_dbname = "";
2796+
database_dbname = std::string( configdir ) + std::string("/motion.db");
27972797
} else if (pact == PARM_ACT_SET) {
27982798
database_dbname = parm;
27992799
} else if (pact == PARM_ACT_GET) {

0 commit comments

Comments
 (0)