1

I'm working on a.NET 7.0 application that needs to query a PostgreSQL database using Apache Age. To connect to the database, I'm using the Npgsql package.

I've successfully connected to the database with Npgsql, but I'm not sure how to run an Age query and receive the results. I've gone over the documentation for both Npgsql and Apache Age, but I'm still unsure how to go ahead.

I have tried this

using Npgsql;

var connString = "Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase"; using var conn = new NpgsqlConnection(connString); conn.Open();

var cmd = new NpgsqlCommand("MATCH (n)-[:LIKES]->(m) RETURN n.name, m.name", conn); var reader = cmd.ExecuteReader();

// What do I do next with the reader?

4 Answers4

1

The .NET framework is not listed as supported in either the Apache AGE documentation or the GitHub repositories.

So, I don't think so you can use Apache AGE to use PostgreSQL queries in .net application. Thank you.

Raja Rakshak
  • 168
  • 2
0

You can use this to retrieve th rows:

while (reader.Read()){
string name1 = reader.GetValue(0).ToString();
string name2 = reader.GetValue(1).ToString();
Console.WriteLine("{0} likes {1}", name1, name2);}
0

I don't think so that there is any driver for .net framework in apache age so it is not possible to run age queries in your application. As per apache age github we can see in drivers folder that there are drivers for nodejs, python, golang but none for .net (c#).

Umer Freak
  • 21
  • 3
0

In the apache age documentation and in its github repositories, the .net framework is not supported by Apache age it means you cannot run postgresql queries in your .net application.

Aadil Bashir
  • 111
  • 5