Getting Involved With Apache-AGE

Apache AGE
Apache AGE
4 min readOct 12, 2023

--

Apache-AGE is an open-source graph extension for PostgreSQL that enables graph querying and processing capabilities, allowing you to create and manipulate graph databases easily. It extends Postgres to add new features and functions. In this blog, I’ll be demonstrating how to contribute with an example of adding new functions to the AGE source code by creating a sample “Hello, World!” function in the C language.

Apache-AGE has a very active community, contributing on a daily basis and it recently launched AGE v1.4.0, which provides support for the PG version 15 link

Setting up the Environment

Before we get started, make sure that you have the dependencies required for compiling the AGE source code. You can follow the blog here to install, run, and configure Apache-AGE on your system. In this suggested blog, PG version 11.8 is used, but you can change the version of PostgreSQL according to your own requirements.

What can I do to contribute?

You can contribute to Apache-AGE in a lot of ways. For example, you can come up with new functionality that should be there. You can resolve the issues or contribute improvements suggested on the Apache-AGE Github issue page and link. There are many issues, discussions, and improvements suggested by the active community of Apache-AGE on a daily basis.

Additionally, you can also join the Apache-AGE discord channel link, where you can get to know about the active sub-projects and new developments so that you can contribute accordingly and discuss them as well.

In this particular blog, I am going to give you an overview of how to can contribute by adding a new function to the AGE repo.

So let’s start our contribution to Apache-AGE:

Creating a New Function

1. Create a new file named hello_world.c in the src/backend/commands/ directory of the AGE source code.

2. In the hello_world.c file, add the following code that defines the hello_world() function:

Figure-1

This code defines a new function named hello_world() that writes “Hello, World!” to the PostgreSQL server’s log.

3. Add the following lines to the Makefile in the src/backend/commands/ directory to include the hello_world.c file in the compilation process:
The makefile path is on the top directory of the cloned repository

Figure-2

4. Add the signature to the AGE — 1.4.0.SQL at the end of the file

Figure-3

5. Run the make command in the top-level directory of the AGE source code to build the source code.

Figure-4

6. Start the PostgreSQL server by running the pg_ctl command with the start argument:

Figure-5

7. Connect to the PostgreSQL server using the psql command-line tool:

Figure-6

8. Call the hello_world() function using the following SQL command:

Figure-7

Congratulations! You have successfully added a new function to the AGE source code. You can now build upon this example and create more complex functions that can manipulate graph data.

You can drop the current extension to reload it to the Postgres server, i.e. make a fresh load to the modified AGE extension.

Figure-8

Adding regression tests:

After getting everything finished, you need to make sure you have your regression tests added. You can check out how to create your own regression tests there using this blog. Also, make sure you have not affected any of the other functionality of AGE by running the regression tests present in the repository.

Pushing your changes:

After adding these new functionalities, run the regression test and the existing regression test. You are welcome to make a pull request to the Apache-AGE Github repo link. To learn how to make a pull request, you can follow Github's official documentation at the link.

Contact us for more information and directions!

Feel free to contact us via email or leave an issue on the Apache AGE GitHub link. We will answer to the best of our ability and give you directions on how to contribute to the project.

Visit the Apache-AGE website for more information

https://age.apache.org/

Also, join Apache-AGE Discord

Credits: Kamlesh Kumar

--

--

Apache AGE
Apache AGE

is a PostgreSQL extension that provides graph database functionalities