odyssey/README.md

147 lines
2.7 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) */
shapito_read_startup()
2017-06-08 13:17:16 +00:00
2017-06-08 13:51:04 +00:00
/* Read any other PostgreSQL packet */
shapito_read()
2017-06-08 13:07:38 +00:00
```
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 */
shapito_fe_write_startup_message()
2017-06-08 13:17:16 +00:00
/* CancelRequest */
shapito_fe_write_cancel()
2017-06-08 13:17:16 +00:00
/* SSLRequest */
shapito_fe_write_ssl_request()
2017-06-08 13:17:16 +00:00
/* Terminate */
shapito_fe_write_terminate()
2017-06-08 13:17:16 +00:00
/* PasswordMessage */
shapito_fe_write_password()
2017-06-08 13:17:16 +00:00
/* Query */
shapito_fe_write_query()
2017-06-08 13:17:16 +00:00
/* Parse */
shapito_fe_write_parse()
2017-06-08 13:17:16 +00:00
/* Bind */
shapito_fe_write_bind()
2017-06-08 13:17:16 +00:00
/* Describe */
shapito_fe_write_describe();
2017-06-08 13:17:16 +00:00
/* Execute */
shapito_fe_write_execute();
2017-06-08 13:17:16 +00:00
/* Sync */
shapito_fe_write_sync();
2017-06-08 13:07:38 +00:00
```
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 */
shapito_fe_read_ready();
2017-06-08 13:55:16 +00:00
/* BackendKeyData */
shapito_fe_read_key();
2017-06-08 13:55:16 +00:00
/* Authentication messages */
shapito_fe_read_auth();
2017-06-08 13:55:16 +00:00
/* ParameterStatus */
shapito_fe_read_parameter();
2017-06-15 14:23:08 +00:00
/* ErrorResponse */
shapito_fe_read_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 */
shapito_be_write_error()
shapito_be_write_error_fatal()
shapito_be_write_error_panic()
2017-06-08 13:17:16 +00:00
/* NoticeResponse */
shapito_be_write_notice()
2017-06-08 13:17:16 +00:00
/* AuthenticationOk */
shapito_be_write_authentication_ok()
2017-06-08 13:17:16 +00:00
/* AuthenticationCleartextPassword */
shapito_be_write_authentication_clear_text()
2017-06-08 13:17:16 +00:00
/* AuthenticationMD5Password */
shapito_be_write_authentication_md5()
2017-06-08 13:17:16 +00:00
/* BackendKeyData */
shapito_be_write_backend_key_data()
2017-06-08 13:17:16 +00:00
/* ParameterStatus */
shapito_be_write_parameter_status()
2017-06-08 13:17:16 +00:00
/* EmptyQueryResponse */
shapito_be_write_empty_query()
2017-06-08 13:17:16 +00:00
/* CommandComplete */
shapito_be_write_complete()
2017-06-08 13:17:16 +00:00
/* ReadyForQuery */
shapito_be_write_ready()
2017-06-08 13:17:16 +00:00
/* ParseComplete */
shapito_be_write_parse_complete()
2017-06-08 13:17:16 +00:00
/* BindComplete */
shapito_be_write_bind_complete()
2017-06-08 13:17:16 +00:00
/* PortalSuspended */
shapito_be_write_portal_suspended()
2017-06-08 13:17:16 +00:00
/* NoData */
shapito_be_write_no_data()
/* RowDescription */
shapito_be_write_row_description()
shapito_be_write_row_description_add()
/* DataRow */
shapito_be_write_data_row()
shapito_be_write_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 */
shapito_be_read_startup();
2017-06-08 13:55:16 +00:00
/* PasswordMessage */
shapito_be_read_password();
2017-06-08 13:07:38 +00:00
```