Skip to content

Commit 231bdb2

Browse files
Converted SQL file into multiple files. (#1401)
Converted SQL file into multiple files. This pull request is aimed at improving the overall quality of our SQL codebase by converting the main SQL (age-x.x.x.sql) file into multiple smaller files in the sql directory. The primary goal is to enhance code readability, maintainability, and organization for the benefit of the development team.
1 parent 88bd5a8 commit 231bdb2

20 files changed

Lines changed: 4676 additions & 4370 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.so
33
.gitignore
44
build.sh
5+
age--*.*.*.sql
56
.idea
67
.deps
78
.DS_Store

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
MODULE_big = age
1919

20+
age_sql = age--1.4.0.sql
2021

2122

2223
OBJS = src/backend/age.o \
@@ -75,7 +76,12 @@ OBJS = src/backend/age.o \
7576

7677
EXTENSION = age
7778

78-
DATA = age--1.4.0.sql
79+
#SQLS = $(sort ($(wildcard sql/*.sql)))
80+
SQLS := $(shell cat sql/sql_files)
81+
SQLS := $(addprefix sql/,$(SQLS))
82+
SQLS := $(addsuffix .sql,$(SQLS))
83+
84+
DATA_built = $(age_sql)
7985

8086
# sorted in dependency order
8187
REGRESS = scan \
@@ -111,7 +117,7 @@ ag_regress_dir = $(srcdir)/regress
111117
REGRESS_OPTS = --load-extension=age --inputdir=$(ag_regress_dir) --outputdir=$(ag_regress_dir) --temp-instance=$(ag_regress_dir)/instance --port=61958 --encoding=UTF-8 --temp-config $(ag_regress_dir)/age_regression.conf
112118

113119
ag_regress_out = instance/ log/ results/ regression.*
114-
EXTRA_CLEAN = $(addprefix $(ag_regress_dir)/, $(ag_regress_out)) src/backend/parser/cypher_gram.c src/include/parser/cypher_gram_def.h
120+
EXTRA_CLEAN = $(addprefix $(ag_regress_dir)/, $(ag_regress_out)) src/backend/parser/cypher_gram.c src/include/parser/cypher_gram_def.h $(age_sql)
115121

116122
ag_include_dir = $(srcdir)/src/include
117123
PG_CPPFLAGS = -I$(ag_include_dir) -I$(ag_include_dir)/parser
@@ -127,4 +133,7 @@ src/backend/parser/cypher_gram.c: BISONFLAGS += --defines=src/include/parser/cyp
127133
src/backend/parser/cypher_parser.o: src/backend/parser/cypher_gram.c
128134
src/backend/parser/cypher_keywords.o: src/backend/parser/cypher_gram.c
129135

136+
$(age_sql):
137+
@cat $(SQLS) > $@
138+
130139
src/backend/parser/ag_scanner.c: FLEX_NO_BACKUP=yes

0 commit comments

Comments
 (0)