Skip to content

Commit

Permalink
database: pull out database code into a new module
Browse files Browse the repository at this point in the history
We're going to reuse the database controllers for the accounting plugin
  • Loading branch information
niftynei authored and rustyrussell committed Mar 5, 2022
1 parent 03c950b commit ce12d2b
Show file tree
Hide file tree
Showing 37 changed files with 1,478 additions and 1,292 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ configure text eol=lf
# The following files are generated and should not be shown in the
# diffs by default on Github.
doc/lightning*.7 linguist-generated=true
wallet/db_*_sqlgen.c linguist-generated=true
wallet/statements_gettextgen.po linguist-generated=true
db_*_sqlgen.c linguist-generated=true
statements_gettextgen.po linguist-generated=true
*_wiregen.? linguist-generated=true
*_printgen.? linguist-generated=true

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ include external/Makefile
include bitcoin/Makefile
include common/Makefile
include wire/Makefile
include db/Makefile
include hsmd/Makefile
include gossipd/Makefile
include openingd/Makefile
Expand Down
23 changes: 23 additions & 0 deletions db/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/make

DB_LIB_SRC := \
db/bindings.c \
db/exec.c \
db/utils.c

DB_DRIVERS := \
db/db_postgres.c \
db/db_sqlite3.c

DB_SRC := $(DB_LIB_SRC) $(DB_DRIVERS)
DB_HEADERS := $(DB_LIB_SRC:.c=.h) db/common.h

DB_OBJS := $(DB_LIB_SRC:.c=.o) $(DB_DRIVERS:.c=.o)
$(DB_OBJS): $(DB_HEADERS)

# Make sure these depend on everything.
ALL_C_SOURCES += $(DB_SRC)
ALL_C_HEADERS += $(DB_HEADERS)

# DB_SQL_FILES is the list of database files
DB_SQL_FILES := db/exec.c
Loading

0 comments on commit ce12d2b

Please sign in to comment.