From 296595cfea253c8551e6adbbc03f10fb9fdf3258 Mon Sep 17 00:00:00 2001 From: Anton Nesterov Date: Thu, 15 Aug 2024 09:10:49 +0200 Subject: [PATCH] [doc] fix copilot crap Signed-off-by: Anton Nesterov --- pkg/adapter/CommonDialect.go | 8 ++++---- pkg/adapter/DBAdapter.go | 12 ++++++------ pkg/adapter/registry.go | 10 +++++----- pkg/adapter/types.go | 6 +++--- pkg/server/query_handler.go | 18 +++++++++--------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/pkg/adapter/CommonDialect.go b/pkg/adapter/CommonDialect.go index 6fbec26..5228264 100644 --- a/pkg/adapter/CommonDialect.go +++ b/pkg/adapter/CommonDialect.go @@ -7,10 +7,10 @@ import ( utils "l12.xyz/dal/utils" ) -/** -* CommonDialect is a simple implementation of the Dialect interface. -* Should be usable for most SQL databases. -**/ +/* +CommonDialect is a simple implementation of the Dialect interface. +Should be usable for most SQL databases. +*/ type CommonDialect struct { TableName string TableAlias string diff --git a/pkg/adapter/DBAdapter.go b/pkg/adapter/DBAdapter.go index f4e2f87..508bbe0 100644 --- a/pkg/adapter/DBAdapter.go +++ b/pkg/adapter/DBAdapter.go @@ -6,12 +6,12 @@ import ( "time" ) -/** - * DBAdapter - * Automatically creates connections for each database URL. - * Executes queries on the specified database. - * Closes connections older than ConnectionLiveTime -**/ +/* +DBAdapter +Automatically creates connections for each database URL. +Executes queries on the specified database. +Closes connections older than ConnectionLiveTime +*/ type DBAdapter struct { Type string MaxAttempts int diff --git a/pkg/adapter/registry.go b/pkg/adapter/registry.go index bf38618..985cff6 100644 --- a/pkg/adapter/registry.go +++ b/pkg/adapter/registry.go @@ -6,11 +6,11 @@ var DIALECTS = map[string]Dialect{ "sqlite3": CommonDialect{}, } -/** - * Register a new dialect for a given driver name. - * `driverName` is the valid name of the db driver (e.g. "sqlite3", "postgres"). - * `dialect` is an implementation of the Dialect interface. -**/ +/* +Register a new dialect for a given driver name. +`driverName` is the valid name of the db driver (e.g. "sqlite3", "postgres"). +`dialect` is an implementation of the Dialect interface. +*/ func RegisterDialect(driverName string, dialect Dialect) { DIALECTS[driverName] = dialect } diff --git a/pkg/adapter/types.go b/pkg/adapter/types.go index 3fb8a58..631dfda 100644 --- a/pkg/adapter/types.go +++ b/pkg/adapter/types.go @@ -8,9 +8,9 @@ type Query struct { type DialectOpts map[string]string -/** -* Dialect interface provides general utilities for normalizing values for particular DB. -**/ +/* +Dialect interface provides general utilities for normalizing values for particular DB. +*/ type Dialect interface { New(opts DialectOpts) Dialect GetTableName() string diff --git a/pkg/server/query_handler.go b/pkg/server/query_handler.go index a5df9fb..5f83e2c 100644 --- a/pkg/server/query_handler.go +++ b/pkg/server/query_handler.go @@ -9,15 +9,15 @@ import ( "l12.xyz/dal/proto" ) -/** -* QueryHandler is a http.Handler that reads a proto.Request from the request body, -* parses it into a query, executes the query on the provided db and writes the -* result to the response body. -* - The request body is expected to be in msgpack format (proto.Request). -* - The response body is written in msgpack format. -* - The respose is a stream of rows (proto.Row), where the first row is the column names. -* - The columns are sorted alphabetically, so it is client's responsibility to match them and sort as needed. -**/ +/* +QueryHandler is a http.Handler that reads a proto.Request from the request body, +parses it into a query, executes the query on the provided db and writes the +result to the response body. +- The request body is expected to be in msgpack format (proto.Request). +- The response body is written in msgpack format. +- The respose is a stream of rows (proto.Row), where the first row is the column names. +- The columns are sorted alphabetically, so it is client's responsibility to match them and sort as needed. +*/ func QueryHandler(db adapter.DBAdapter) http.Handler { dialect := adapter.GetDialect(db.Type) return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {