mock-data: This won't work if the table name has uppercase characters
Have a simple database with a table, named “bills” and run the standard
./mockd-mac.dms postgres -d [dbname] -t bills
and you will get all the data filled in and it works. But if your table is named Bills instead the following will happen:
Command
Run ./mockd-mac.dms postgres -d [dbname] -t Bills
OR
Run ./mockd-mac.dms postgres -d [dbname] -t "Bills"
OR
Run ./mockd-mac.dms postgres -d [dbname] -t bills
What occurred
In all cases, the error will be exactly:
Cannot extracting the column info, error from the database: pq: relation "bills" does not exist
What you expected to occur
I expected the table to get a new row.
Table or Database structure
DDL:
-- DDL generated by Postico 1.5.4
-- Not all database features are supported. Do not use for backup.
-- Table Definition ----------------------------------------------
CREATE TABLE "Bills" (
"CPRLink" integer,
"companyId" integer,
"Comprobante" character varying(30) NOT NULL,
"Agrupador" character varying(200),
"CAENro" bigint,
"CAEVto" character varying(10),
"Codigo" character varying(10),
"Nombre" character varying(255),
"CondIVA" character varying(255),
"CUIT" character varying(30),
"Domicilio" character varying(255),
"Localidad" character varying(255),
"Provincia" character varying(255),
"Fecha" timestamp with time zone,
"FechaVenc" timestamp with time zone,
"SaldoAnterior" character varying(255),
"TotalSIVA" character varying(255),
"IVA" character varying(255),
"DGR" character varying(255),
notified boolean NOT NULL DEFAULT false,
"Total" character varying(255),
"PagoMinimo" character varying(255),
"createdAt" timestamp with time zone DEFAULT 'now'::text::timestamp(3) with time zone,
"updatedAt" timestamp with time zone DEFAULT 'now'::text::timestamp(3) with time zone,
CONSTRAINT bills_pkey PRIMARY KEY ("CPRLink", "companyId")
);
-- Indices -------------------------------------------------------
CREATE UNIQUE INDEX bills_pkey ON "Bills"("CPRLink" int4_ops,"companyId" int4_ops);
MockD Version
v1.3
Database Details
Postgres 10
Platform Details
OS X Mojave
Any other relevant information
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (14 by maintainers)
Commits related to this issue
- fix(GetConstraintsPertab): Also work with non-lowercase column names Possibly closes #6 — committed to janpio/mock-data by janpio 4 years ago
- fix(GetConstraintsPertab): Also work with non-lowercase column names (#10) * fix(GetConstraintsPertab): Also work with non-lowercase column names Possibly closes #6 * Fix for uppercase column (... — committed to faisaltheparttimecoder/mock-data by janpio 4 years ago
- Upper case (#15) * fix(GetConstraintsPertab): Also work with non-lowercase column names Possibly closes #6 * Fix for upper case columns + If the table has upper case columns then it fails , ... — committed to faisaltheparttimecoder/mock-data by faisaltheparttimecoder 4 years ago
Nice, thanks @janpio , looks good 😃 I will have this merged. There is another place where this fails, I will add a commit to your pull request in few minutes …
fixed on v2.0