/
doc.go
60 lines (59 loc) · 2.54 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2015-present, Cyrill @ Schumacher.fm and the CoreStore contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package dml handles the SQL DML for super fast performance,
// type safety and convenience.
//
// Aim: Allow a developer to easily modify a SQL query without type assertion of
// parts of the query. No reflection magic has been used so we must achieve
// type safety with code generation.
//
// This package works only with MySQL and its derivates like MariaDB or Percona.
//
// # Abbreviations
//
// DML (https://en.wikipedia.org/wiki/Data_manipulation_language) Select,
// Insert, Update and Delete.
//
// DDL (https://en.wikipedia.org/wiki/Data_definition_language) Create, Drop,
// Alter, and Rename.
//
// DCL (https://en.wikipedia.org/wiki/Data_control_language) Grant and Revoke.
//
// CRUD (https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) Create,
// Read, Update and Delete.
//
// https://mariadb.com/kb/en/mariadb/documentation/
//
// Practical Guide to SQL Transaction Isolation: https://begriffs.com/posts/2017-08-01-practical-guide-sql-isolation.html
//
// NetSPI SQL Injection Wiki: https://sqlwiki.netspi.com/
//
// TODO(CyS) think about named locks:
// https://news.ycombinator.com/item?id=14907679
// https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock
// Database locks should not be used by the average developer. Understand
// optimistic concurrency and use serializable isolation.
//
// TODO(CyS) Soft deletion with system versioned tables (MariaDB only) see here
//
// where they discuss various concepts about soft deletion:
// https://news.ycombinator.com/item?id=34202606 and here https://news.ycombinator.com/item?id=32156009
//
// TODO(CyS) refactor some parts of the code once Go implements generics ;-)
//
// TODO(CyS) implement usage of window functions:
// - https://mariadb.com/kb/en/library/window-functions/
// - https://dev.mysql.com/doc/refman/8.0/en/window-functions-usage.html
// - https://blog.statsbot.co/sql-window-functions-tutorial-b5075b87d129
package dml