Skip to content

Commit 56d0834

Browse files
Converted SQL mail into multiple files. (#1401) (#1432)
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 00ca796 commit 56d0834

20 files changed

+4680
-4375
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: 13 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
OBJS = src/backend/age.o \
2223
src/backend/catalog/ag_catalog.o \
@@ -74,7 +75,12 @@ OBJS = src/backend/age.o \
7475

7576
EXTENSION = age
7677

77-
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)
7884

7985
# sorted in dependency order
8086
REGRESS = scan \
@@ -109,7 +115,7 @@ ag_regress_dir = $(srcdir)/regress
109115
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
110116

111117
ag_regress_out = instance/ log/ results/ regression.*
112-
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)
113119

114120
GEN_KEYWORDLIST = $(PERL) -I ./tools/ ./tools/gen_keywordlist.pl
115121
GEN_KEYWORDLIST_DEPS = ./tools/gen_keywordlist.pl tools/PerfectHash.pm
@@ -133,4 +139,9 @@ src/backend/parser/cypher_gram.c: BISONFLAGS += --defines=src/include/parser/cyp
133139
src/backend/parser/cypher_parser.o: src/backend/parser/cypher_gram.c
134140
src/backend/parser/cypher_keywords.o: src/backend/parser/cypher_gram.c
135141

142+
$(age_sql):
143+
@cat $(SQLS) > $@
144+
136145
src/backend/parser/ag_scanner.c: FLEX_NO_BACKUP=yes
146+
147+
installcheck: export LC_COLLATE=C

0 commit comments

Comments
 (0)