master
ブランチ master
LittleBeast / src / Std / Lib / Db / Convert / Target.php
2.8 KB、72行 生 Blame 履歴
1<?php
2/*************************************************************
3# 076 License
4
5Copyright (c) テクニカル諏訪子
6
7Permission is hereby granted to any person obtaining a copy of the software
8Little Beast (the "Software") to use, modify, merge, copy, publish, distribute,
9sublicense, and/or sell copies of the Software, subject to the following conditions:
10
11 1. **Origin Attribution**:
12 - You must not misrepresent the origin of the Software; you must not claim
13 you created the original Software.
14 - If the Software is used in a product, you must either:
15 a. Provide clear attribution in the product's documentation, user interface,
16 or other visible areas, **OR**
17 b. Pay the original developers a fee they specify in writing.
18 2. **Usage Restriction**:
19 - The Software, or any derivative works, dependencies, or libraries
20 incorporating it, must not be used for censorship or to suppress freedom of
21 speech, expression, or creativity. Prohibited uses include, but are not
22 limited to:
23 - Censorship of so-called "hate speech", visuals, non-mainstream opinions,
24 ideas, or objective reality.
25 - Tools or systems designed to restrict access to information or
26 artistic works.
27 3. **Notice Preservation**:
28 - This license and the above copyright notice must remain intact in all copies
29 of the source code.
30
31THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
32INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
33PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
34HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
35CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
36OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 */
38namespace Std\Lib\Db\Convert;
39
40/**
41 * 変換の先(Std\Lib\Db\Convertを参照)
42 */
43interface Target {
44 /**
45 * 書き込みを始める
46 *
47 * @param bool $drop 同じ名前のテーブルが有れば消す(falseなら失敗にする)
48 */
49 public function begin(bool $drop): void;
50
51 /** テーブルを作る(インデックスはfinishTable()で) */
52 public function createTable(array $t): void;
53
54 /**
55 * 行を書く
56 *
57 * @param array $t テーブル
58 * @param array $rows 共通の形の値の配列の配列
59 */
60 public function insertRows(array $t, array $rows): void;
61
62 /** テーブルの最後(インデックス、自動の番号の続き) */
63 public function finishTable(array $t): void;
64
65 /** 書き込みを終える */
66 public function end(): void;
67
68 /** 失敗した場合(トランザクションのロールバック等) */
69 public function abort(): void;
70
71 public function warnings(): array;
72}