Skip to content

Commit

Permalink
Converted SQL file into multiple files. (apache#1401)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
muhammadshoaib committed Dec 4, 2023
1 parent 88bd5a8 commit 231bdb2
Show file tree
Hide file tree
Showing 20 changed files with 4,676 additions and 4,370 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.so
.gitignore
build.sh
age--*.*.*.sql
.idea
.deps
.DS_Store
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

MODULE_big = age

age_sql = age--1.4.0.sql


OBJS = src/backend/age.o \
Expand Down Expand Up @@ -75,7 +76,12 @@ OBJS = src/backend/age.o \

EXTENSION = age

DATA = age--1.4.0.sql
#SQLS = $(sort ($(wildcard sql/*.sql)))
SQLS := $(shell cat sql/sql_files)
SQLS := $(addprefix sql/,$(SQLS))
SQLS := $(addsuffix .sql,$(SQLS))

DATA_built = $(age_sql)

# sorted in dependency order
REGRESS = scan \
Expand Down Expand Up @@ -111,7 +117,7 @@ ag_regress_dir = $(srcdir)/regress
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

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

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

$(age_sql):
@cat $(SQLS) > $@

src/backend/parser/ag_scanner.c: FLEX_NO_BACKUP=yes
Loading

0 comments on commit 231bdb2

Please sign in to comment.