@@ -8,52 +8,22 @@ Built on [pgwire](https://github.com/sunng87/pgwire) to provide PostgreSQL wire
88It was originally an example of the [ pgwire] ( https://github.com/sunng87/pgwire )
99project.
1010
11- ## ✨ Key Features
12-
13- - 🔌 ** Full PostgreSQL Wire Protocol** - Compatible with all PostgreSQL clients and drivers
14- - 🛡️ ** Security Features** - Authentication, RBAC, and SSL/TLS encryption
15- - 🏗️ ** Complete System Catalogs** - Real ` pg_catalog ` tables with accurate metadata
16- - 📊 ** Advanced Data Types** - Comprehensive Arrow ↔ PostgreSQL type mapping
17- - 🔄 ** Transaction Support** - ACID transaction lifecycle (BEGIN/COMMIT/ROLLBACK)
18- - ⚡ ** High Performance** - Apache DataFusion's columnar query execution
19-
20- ## 🎯 Features
21-
22- ### Core Functionality
23- - ✅ Library and CLI tool
24- - ✅ PostgreSQL wire protocol compatibility
25- - ✅ Complete ` pg_catalog ` system tables
26- - ✅ Arrow ↔ PostgreSQL data type mapping
27- - ✅ PostgreSQL functions (version, current_schema, has_table_privilege, etc.)
28-
29- ### Security & Authentication
30- - ✅ User authentication and RBAC
31- - ✅ Granular permissions (SELECT, INSERT, UPDATE, DELETE, CREATE, DROP)
32- - ✅ Role inheritance and grant management
33- - ✅ SSL/TLS encryption
34- - ✅ Query-level permission checking
35-
36- ### Transaction Support
37- - ✅ ACID transaction lifecycle
38- - ✅ BEGIN/COMMIT/ROLLBACK with all variants
39- - ✅ Failed transaction handling and recovery
40-
41- ### Future Enhancements
42- - ⏳ Connection pooling optimizations
43- - ⏳ Advanced authentication (LDAP, certificates)
44- - ⏳ COPY protocol for bulk data loading
45-
46- ## 🔐 Authentication
47-
48- Supports standard pgwire authentication methods:
49-
50- - ** Cleartext** : ` CleartextStartupHandler ` for simple password authentication
51- - ** MD5** : ` MD5StartupHandler ` for MD5-hashed passwords
52- - ** SCRAM** : ` SASLScramAuthStartupHandler ` for secure authentication
11+ ## Scope of the Project
12+
13+ - ` datafusion-postgres ` : Postgres frontend for datafusion, as a library.
14+ - Serving Datafusion ` SessionContext ` with pgwire library
15+ - Customizible authentication
16+ - Permission control
17+ - Built-in ` pg_catalog ` tables
18+ - Built-in postgres functions for common meta queries
19+ - ` datafusion-postgres-cli ` : A cli tool starts a postgres compatible server for
20+ datafusion supported file formats, just like python's ` SimpleHTTPServer ` .
21+ - ` arrow-pg ` : A data type mapping, encoding/decoding library for arrow and
22+ postgres(pgwire) data types.
5323
5424See ` auth.rs ` for complete implementation examples using ` DfAuthSource ` .
5525
56- ## 🚀 Quick Start
26+ ## Quick Start
5727
5828### The Library ` datafusion-postgres `
5929
@@ -83,16 +53,15 @@ serve(session_context, &server_options).await
8353
8454### Security Features
8555
86- ``` rust
87- // The server automatically includes:
88- // - User authentication (default postgres superuser)
89- // - Role-based access control with predefined roles:
90- // - readonly: SELECT permissions
91- // - readwrite: SELECT, INSERT, UPDATE, DELETE permissions
92- // - dbadmin: Full administrative permissions
93- // - SSL/TLS encryption when certificates are provided
94- // - Query-level permission checking
95- ```
56+ The server automatically includes:
57+
58+ - User authentication (default postgres superuser)
59+ - Role-based access control with predefined roles:
60+ - readonly: SELECT permissions
61+ - readwrite: SELECT, INSERT, UPDATE, DELETE permissions
62+ - dbadmin: Full administrative permissions
63+ - SSL/TLS encryption when certificates are provided
64+ - Query-level permission checking
9665
9766### The CLI ` datafusion-postgres-cli `
9867
@@ -131,7 +100,7 @@ datafusion-postgres-cli \
131100 --tls-cert server.crt \
132101 --tls-key server.key
133102
134- # Run without encryption (development only)
103+ # Run without encryption (development only)
135104datafusion-postgres-cli --csv data:sample.csv
136105```
137106
@@ -161,13 +130,13 @@ psql -h 127.0.0.1 -p 5432 -U postgres
161130
162131``` sql
163132postgres=> SELECT COUNT (* ) FROM climate;
164- count
133+ count
165134-- -----
166135 1462
167136(1 row)
168137
169138postgres=> SELECT date , meantemp FROM climate WHERE meantemp > 35 LIMIT 5 ;
170- date | meantemp
139+ date | meantemp
171140-- ----------+----------
172141 2017 - 05 - 15 | 36 .9
173142 2017 - 05 - 16 | 37 .9
@@ -179,7 +148,7 @@ postgres=> SELECT date, meantemp FROM climate WHERE meantemp > 35 LIMIT 5;
179148postgres=> BEGIN ;
180149BEGIN
181150postgres=> SELECT AVG (meantemp) FROM climate;
182- avg
151+ avg
183152-- ----------------
184153 25 .4955206557617
185154(1 row)
0 commit comments