odyssey/README.md

147 lines
2.4 KiB
Markdown
Raw Normal View History

2017-06-08 13:39:04 +00:00
**shapito**
2017-06-07 11:26:46 +00:00
2017-06-08 13:07:38 +00:00
PostgreSQL protocol-level client C library.
2017-06-08 13:39:04 +00:00
Library is designed to provide most of the functionality needed to write or read
2017-06-08 13:30:59 +00:00
[PostgreSQL protocol messages](https://www.postgresql.org/docs/9.6/static/protocol.html).
2017-06-08 13:39:04 +00:00
Both Frontend (client to server) and Backend (server to client) messages are supported, making
it possible to write client or server simulation applications.
2017-06-08 13:30:59 +00:00
2017-06-08 13:39:04 +00:00
No network part is supported. Only buffer management and packet validation.
2017-06-08 13:07:38 +00:00
2017-06-08 13:51:04 +00:00
**PostgreSQL packet readers**
2017-06-08 13:07:38 +00:00
```C
2017-06-08 13:55:16 +00:00
/* Read initial message (StartupMessage, CancelRequest, SSLRequest) */
2017-06-08 13:07:38 +00:00
so_read_startup()
2017-06-08 13:17:16 +00:00
2017-06-08 13:51:04 +00:00
/* Read any other PostgreSQL packet */
2017-06-08 13:07:38 +00:00
so_read()
```
2017-06-08 13:51:04 +00:00
**FRONTEND**
**Write messages to Backend**
2017-06-08 13:07:38 +00:00
```C
2017-06-08 13:17:16 +00:00
/* StartupMessage */
2017-06-08 13:07:38 +00:00
so_fewrite_startup_message()
2017-06-08 13:17:16 +00:00
/* CancelRequest */
2017-06-08 13:07:38 +00:00
so_fewrite_cancel()
2017-06-08 13:17:16 +00:00
/* SSLRequest */
2017-06-08 13:07:38 +00:00
so_fewrite_ssl_request()
2017-06-08 13:17:16 +00:00
/* Terminate */
2017-06-08 13:07:38 +00:00
so_fewrite_terminate()
2017-06-08 13:17:16 +00:00
/* PasswordMessage */
2017-06-08 13:07:38 +00:00
so_fewrite_password()
2017-06-08 13:17:16 +00:00
/* Query */
2017-06-08 13:07:38 +00:00
so_fewrite_query()
2017-06-08 13:17:16 +00:00
/* Parse */
2017-06-08 13:07:38 +00:00
so_fewrite_parse()
2017-06-08 13:17:16 +00:00
/* Bind */
2017-06-08 13:07:38 +00:00
so_fewrite_bind()
2017-06-08 13:17:16 +00:00
/* Describe */
2017-06-08 13:07:38 +00:00
so_fewrite_describe();
2017-06-08 13:17:16 +00:00
/* Execute */
2017-06-08 13:07:38 +00:00
so_fewrite_execute();
2017-06-08 13:17:16 +00:00
/* Sync */
2017-06-08 13:07:38 +00:00
so_fewrite_sync();
```
2017-06-08 13:51:04 +00:00
**Read messages from Backend**
2017-06-08 13:07:38 +00:00
```C
2017-06-08 13:55:16 +00:00
/* ReadyForQuery */
2017-06-08 13:07:38 +00:00
so_feread_ready();
2017-06-08 13:55:16 +00:00
/* BackendKeyData */
2017-06-08 13:07:38 +00:00
so_feread_key();
2017-06-08 13:55:16 +00:00
/* Authentication messages */
2017-06-08 13:07:38 +00:00
so_feread_auth();
2017-06-08 13:55:16 +00:00
/* ParameterStatus */
2017-06-08 13:07:38 +00:00
so_feread_parameter();
2017-06-15 14:23:08 +00:00
/* ErrorResponse */
so_feread_error();
2017-06-08 13:07:38 +00:00
```
2017-06-08 13:51:04 +00:00
**BACKEND**
**Write messages to Frontend**
2017-06-08 13:07:38 +00:00
```C
2017-06-08 13:17:16 +00:00
/* ErrorResponse */
2017-06-08 13:07:38 +00:00
so_bewrite_error()
so_bewrite_error_fatal()
so_bewrite_error_panic()
2017-06-08 13:17:16 +00:00
/* NoticeResponse */
2017-06-08 13:07:38 +00:00
so_bewrite_notice()
2017-06-08 13:17:16 +00:00
/* AuthenticationOk */
2017-06-08 13:07:38 +00:00
so_bewrite_authentication_ok()
2017-06-08 13:17:16 +00:00
/* AuthenticationCleartextPassword */
2017-06-08 13:07:38 +00:00
so_bewrite_authentication_clear_text()
2017-06-08 13:17:16 +00:00
/* AuthenticationMD5Password */
2017-06-08 13:07:38 +00:00
so_bewrite_authentication_md5()
2017-06-08 13:17:16 +00:00
/* BackendKeyData */
2017-06-08 13:07:38 +00:00
so_bewrite_backend_key_data()
2017-06-08 13:17:16 +00:00
/* ParameterStatus */
2017-06-08 13:07:38 +00:00
so_bewrite_parameter_status()
2017-06-08 13:17:16 +00:00
/* EmptyQueryResponse */
2017-06-08 13:07:38 +00:00
so_bewrite_empty_query()
2017-06-08 13:17:16 +00:00
/* CommandComplete */
2017-06-08 13:07:38 +00:00
so_bewrite_complete()
2017-06-08 13:17:16 +00:00
/* ReadyForQuery */
2017-06-08 13:07:38 +00:00
so_bewrite_ready()
2017-06-08 13:17:16 +00:00
/* ParseComplete */
2017-06-08 13:07:38 +00:00
so_bewrite_parse_complete()
2017-06-08 13:17:16 +00:00
/* BindComplete */
2017-06-08 13:07:38 +00:00
so_bewrite_bind_complete()
2017-06-08 13:17:16 +00:00
/* PortalSuspended */
2017-06-08 13:07:38 +00:00
so_bewrite_portal_suspended()
2017-06-08 13:17:16 +00:00
/* NoData */
2017-06-08 13:07:38 +00:00
so_bewrite_no_data()
/* RowDescription */
so_bewrite_row_description()
so_bewrite_row_description_add()
/* DataRow */
so_bewrite_data_row()
so_bewrite_data_row_add()
2017-06-08 13:07:38 +00:00
```
2017-06-08 13:51:04 +00:00
**Read messages from Frontend**
2017-06-08 13:30:59 +00:00
2017-06-08 13:07:38 +00:00
```C
2017-06-08 13:55:16 +00:00
/* Read StartupMessage, CancelRequest or SSLRequest */
2017-06-08 13:07:38 +00:00
so_beread_startup();
2017-06-08 13:55:16 +00:00
/* PasswordMessage */
2017-06-08 13:07:38 +00:00
so_beread_password();
```