[doc] fix copilot crap

Signed-off-by: Anton Nesterov <anton@demiurg.io>
This commit is contained in:
Anton Nesterov 2024-08-15 09:10:49 +02:00
parent 7f5c2a32cc
commit 296595cfea
No known key found for this signature in database
GPG key ID: 59121E8AE2851FB5
5 changed files with 27 additions and 27 deletions

View file

@ -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

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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) {