{"id":19322227,"url":"https://github.com/seddryck/pgnoli","last_synced_at":"2025-04-22T19:31:24.946Z","repository":{"id":192264108,"uuid":"686387661","full_name":"Seddryck/Pgnoli","owner":"Seddryck","description":"Pgnoli is a .NET implementation of the PostgreSQL wire protocol v3.  It gives you some traits to implement your own PostgreSQL compatible servers (and client if there is case Npgsql does not fit).","archived":false,"fork":false,"pushed_at":"2025-01-04T20:18:01.000Z","size":1371,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-02T02:53:02.632Z","etag":null,"topics":["database-driver","postgresql","postgresql-driver","wire-protocol"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seddryck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-02T16:12:04.000Z","updated_at":"2025-01-04T20:17:27.000Z","dependencies_parsed_at":"2023-11-12T21:26:41.400Z","dependency_job_id":"41164609-53e5-4f74-9ab8-4970b81adf63","html_url":"https://github.com/Seddryck/Pgnoli","commit_stats":null,"previous_names":["seddryck/pgnoli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FPgnoli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FPgnoli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FPgnoli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FPgnoli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seddryck","download_url":"https://codeload.github.com/Seddryck/Pgnoli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250308358,"owners_count":21409253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-driver","postgresql","postgresql-driver","wire-protocol"],"created_at":"2024-11-10T01:40:36.083Z","updated_at":"2025-04-22T19:31:24.935Z","avatar_url":"https://github.com/Seddryck.png","language":"C#","readme":"# Pgnoli\nPgnoli is a .NET implementation of the PostgreSQL wire protocol v3. \nIt gives you some traits to implement your own PostgreSQL compatible servers (and client if there is case [Npgsql](https://github.com/Npgsql/Npgsql) does not fit).\n\nPostgresql wire protocol is actually a general purpose Layer-7 application protocol. It is not bound with SQL, and can be used for any query language, data format or even natural language. It is possible to build a chat bot that use psql as client.\n\n- [X] (De)serialization of messages for Startup flow\n- [X] (De)serialization of messages for Simple Query flow\n- [X] (De)serialization of messages for Extended Query flow\n- [X] (De)serialization of types for binary encoding\n- [X] (De)serialization of types for text encoding\n- [X] Support of DateStyle for encoding Date/Time related types\n\n![Logo](https://raw.githubusercontent.com/Seddryck/Pgnoli/main/assets/logo/Pgnoli-logo.png)\n\n[About][] | [Quickstart][]\n\n[About]: #about (About)\n[Quickstart]: #quickstart (Quickstart)\n\n## About\n\n**Social media:** [![website](https://img.shields.io/badge/website-seddryck.github.io/Pgnoli-fe762d.svg)](https://seddryck.github.io/Pgnoli)\n[![twitter badge](https://img.shields.io/badge/twitter%20Pgnoli-@Seddryck-blue.svg?style=flat\u0026logo=twitter)](https://twitter.com/Seddryck)\n\n**Releases:** [![nuget](https://img.shields.io/nuget/v/Pgnoli.svg)](https://www.nuget.org/packages/Pgnoli/)\n[![licence badge](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](https://github.com/Seddryck/Pgnoli/blob/master/LICENSE)\n\n**Dev. activity:** [![GitHub last commit](https://img.shields.io/github/last-commit/Seddryck/Pgnoli.svg)](https://github.com/Seddryck/Pgnoli/commits)\n![Still maintained](https://img.shields.io/maintenance/yes/2025.svg)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/y/Seddryck/Pgnoli)\n\n**Continuous integration builds:** [![Build status](https://ci.appveyor.com/api/projects/status/80321ajt5beih60f?svg=true)](https://ci.appveyor.com/project/Seddryck/Pgnoli/)\n[![Tests](https://img.shields.io/appveyor/tests/seddryck/Pgnoli.svg)](https://ci.appveyor.com/project/Seddryck/Pgnoli/build/tests)\n[![CodeFactor](https://www.codefactor.io/repository/github/seddryck/Pgnoli/badge)](https://www.codefactor.io/repository/github/seddryck/Pgnoli)\n[![codecov](https://codecov.io/github/Seddryck/Pgnoli/branch/main/graph/badge.svg?token=9ZSJ6N0X9E)](https://codecov.io/github/Seddryck/Pgnoli)\n\u003c!--[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSeddryck%2FPgnoli.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSeddryck%2FPgnoli?ref=badge_shield)--\u003e\n\n**Status:** [![stars badge](https://img.shields.io/github/stars/Seddryck/Pgnoli.svg)](https://github.com/Seddryck/Pgnoli/stargazers)\n[![Bugs badge](https://img.shields.io/github/issues/Seddryck/Pgnoli/bug.svg?color=red\u0026label=Bugs)](https://github.com/Seddryck/Pgnoli/issues?utf8=%E2%9C%93\u0026q=is:issue+is:open+label:bug+)\n[![Features badge](https://img.shields.io/github/issues/seddryck/Pgnoli/new-feature.svg?color=purple\u0026label=Feature%20requests)](https://github.com/Seddryck/Pgnoli/issues?utf8=%E2%9C%93\u0026q=is:issue+is:open+label:new-feature+)\n[![Top language](https://img.shields.io/github/languages/top/seddryck/Pgnoli.svg)](https://github.com/Seddryck/Pgnoli/search?l=C%23)\n\n## Quickstart\n\nPgnoli is a .NET assembly and can be installed as a package next to your project with the help of `Nuget CLI` or `dotnet.exe` \n\n```bash\ndotnet add package Pgnoli\n```\n\nWhen receiving a message from the client your solution can use the `FrontendParser` class to deserialize the message contained in an array of bytes.\n\n```csharp\nvar parser = new FrontendParser();\nvar msg = parser.Parse(bytes);\n```\n\nThe parser returns a strongly typed message implementing the interface `IMessage`. Most of the messages inherits from the class `CodeMessage` exposing a property Code of one char.\n\nOnce the message is parsed, you can access its payload, using the property `Payload`. The content of the payload depends of the message class, i.e. for a [Query message](https://www.postgresql.org/docs/current/protocol-message-formats.html), the payload contains the SQL query.\n\n```csharp\nvar queryMsg = msg as Query;\nConsole.WriteLine(queryMsh.Sql);\n```\n\nTo create a message, you can use the static methods offered by the class implementing these messages. These methods depends of the messages, i.e. to create a message `ReadyForQuery`, you can use the static method `Idle`.\nTo effectively get your message you should call the `Build()` method.\n\n```csharp\nvar msg = ReadyForQuery.Idle.Build();\n```\n\nSome messages accept optional informations. You can communicate them with the help of `With(...)` functions. i.e. the message `Bind` can create messages for named and unnamed portals but also accept the different parameters and how the result should be serialized. This last element can be defined with the methods `WithAllResultsAsText()` or `WithAllResultsAsBinary()` or for each column of the result, we can define the encoding by chaining the calls to `WithResultFormat(...)`.\n\n```csharp\nvar msg = Bind.Portal(\"destination\", \"source\").WithAllResultsAsBinary().Build();\n```\n\nThe handling of the encoding in both text and binary formats is done with the classes from the `TypeHandlers` namespace.\nHowever in most cases, you won't need them as the handling is directly managed within the class implementing the messages.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseddryck%2Fpgnoli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseddryck%2Fpgnoli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseddryck%2Fpgnoli/lists"}