chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
import {
|
||||
doltCommitFields,
|
||||
doltDocsFields,
|
||||
doltStatusFields,
|
||||
} from "../fields.js";
|
||||
|
||||
const readmeText = `# README
|
||||
## My List
|
||||
|
||||
- Item 1
|
||||
- Item 2
|
||||
`;
|
||||
|
||||
const updatedReadmeText = `${readmeText}-Item 3`;
|
||||
|
||||
export const docsTests = [
|
||||
{
|
||||
q: "select * from dolt.docs",
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 0,
|
||||
oid: null,
|
||||
rows: [],
|
||||
fields: doltDocsFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: "INSERT INTO dolt.docs VALUES ($1, $2);",
|
||||
p: ["README.md", readmeText],
|
||||
res: {
|
||||
command: "INSERT",
|
||||
rowCount: 1,
|
||||
oid: 0,
|
||||
rows: [],
|
||||
fields: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `select * from dolt.docs where doc_name=$1`,
|
||||
p: ["README.md"],
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 1,
|
||||
oid: null,
|
||||
rows: [{ doc_name: "README.md", doc_text: readmeText }],
|
||||
fields: doltDocsFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: "INSERT INTO dolt.docs VALUES ($1, $2) ON CONFLICT (doc_name) DO UPDATE SET doc_text = $2",
|
||||
p: ["README.md", updatedReadmeText],
|
||||
res: {
|
||||
command: "INSERT",
|
||||
rowCount: 2, // TODO: This should be 1, but there's a bug in the GMS iterators that overcounts
|
||||
oid: 0,
|
||||
rows: [],
|
||||
fields: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `select * from dolt.docs where doc_name=$1`,
|
||||
p: ["README.md"],
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 1,
|
||||
oid: null,
|
||||
rows: [{ doc_name: "README.md", doc_text: updatedReadmeText }],
|
||||
fields: doltDocsFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `SELECT * FROM dolt.status`,
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 1,
|
||||
oid: null,
|
||||
rows: [{ table_name: "dolt.docs", staged: false, status: "new table" }],
|
||||
fields: doltStatusFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `SELECT DOLT_COMMIT('-A', '-m', $1::text)`,
|
||||
p: ["Add dolt.docs table"],
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 1,
|
||||
oid: null,
|
||||
rows: [{ dolt_commit: "" }],
|
||||
fields: doltCommitFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `select * from dolt.docs where doc_name=$1`,
|
||||
p: ["README.md"],
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 1,
|
||||
oid: null,
|
||||
rows: [{ doc_name: "README.md", doc_text: updatedReadmeText }],
|
||||
fields: doltDocsFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: "DELETE FROM dolt.docs WHERE doc_name=$1",
|
||||
p: ["README.md"],
|
||||
res: {
|
||||
command: "DELETE",
|
||||
rowCount: 1,
|
||||
oid: null,
|
||||
rows: [],
|
||||
fields: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `select * from dolt.docs where doc_name=$1`,
|
||||
p: ["README.md"],
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 0,
|
||||
oid: null,
|
||||
rows: [],
|
||||
fields: doltDocsFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `SET SEARCH_PATH = 'public,';`,
|
||||
res: {
|
||||
command: "SET",
|
||||
rowCount: null,
|
||||
oid: null,
|
||||
rows: [],
|
||||
fields: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `select * from dolt.docs where doc_name=$1`,
|
||||
p: ["README.md"],
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 0,
|
||||
oid: null,
|
||||
rows: [],
|
||||
fields: doltDocsFields,
|
||||
},
|
||||
},
|
||||
{
|
||||
q: `SELECT DOLT_COMMIT('-A', '-m', $1::text)`,
|
||||
p: ["Remove README"],
|
||||
res: {
|
||||
command: "SELECT",
|
||||
rowCount: 1,
|
||||
oid: null,
|
||||
rows: [{ dolt_commit: "" }],
|
||||
fields: doltCommitFields,
|
||||
},
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user