Skip to content

Commit f6e6af7

Browse files
Converted SQL mail into multiple files. (#1401)
Converted SQL mail 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 9889fa6 commit f6e6af7

20 files changed

+4708
-4405
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.o
22
*.so
33
build.sh
4+
age--*.*.*.sql
45
.idea
56
.deps
67
.DS_Store

Makefile

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

1818
MODULE_big = age
1919

20-
20+
age_sql = age--1.4.0.sql
2121

2222
OBJS = src/backend/age.o \
2323
src/backend/catalog/ag_catalog.o \
@@ -75,7 +75,12 @@ OBJS = src/backend/age.o \
7575

7676
EXTENSION = age
7777

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

8085
# sorted in dependency order
8186
REGRESS = scan \
@@ -110,7 +115,7 @@ ag_regress_dir = $(srcdir)/regress
110115
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
111116

112117
ag_regress_out = instance/ log/ results/ regression.*
113-
EXTRA_CLEAN = $(addprefix $(ag_regress_dir)/, $(ag_regress_out)) src/backend/parser/cypher_gram.c src/include/parser/cypher_gram_def.h src/include/parser/cypher_kwlist_d.h
118+
EXTRA_CLEAN = $(addprefix $(ag_regress_dir)/, $(ag_regress_out)) src/backend/parser/cypher_gram.c src/include/parser/cypher_gram_def.h src/include/parser/cypher_kwlist_d.h $(age_sql)
114119

115120
GEN_KEYWORDLIST = $(PERL) -I ./tools/ ./tools/gen_keywordlist.pl
116121
GEN_KEYWORDLIST_DEPS = ./tools/gen_keywordlist.pl tools/PerfectHash.pm
@@ -134,6 +139,9 @@ src/backend/parser/cypher_gram.c: BISONFLAGS += --defines=src/include/parser/cyp
134139
src/backend/parser/cypher_parser.o: src/backend/parser/cypher_gram.c
135140
src/backend/parser/cypher_keywords.o: src/backend/parser/cypher_gram.c
136141

142+
$(age_sql):
143+
@cat $(SQLS) > $@
144+
137145
src/backend/parser/ag_scanner.c: FLEX_NO_BACKUP=yes
138146

139147
installcheck: export LC_COLLATE=C

0 commit comments

Comments
 (0)