From b5b35ec3db0700bd78c1b84a3d02d579cd2adf56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20Moravec?= Date: Sun, 28 Jan 2024 20:55:25 +0100 Subject: [PATCH] fix: better comment for table oid hashing --- server/src/proto_wrapper.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/proto_wrapper.rs b/server/src/proto_wrapper.rs index c03f27f..dfcb7ed 100644 --- a/server/src/proto_wrapper.rs +++ b/server/src/proto_wrapper.rs @@ -113,7 +113,8 @@ fn column_to_description(schema: &TableSchema, column: Column) -> anyhow::Result }) } -/// Stable random number based on string +/// Hashes the table name into single i32 used as a substitute for the table OID +/// in the PostgreSQL protocol. fn table_name_to_oid(table_name: &str) -> i32 { let mut rng: Pcg64 = Seeder::from(table_name).make_rng(); rng.gen::()