SQLite Forum

Input from Windows Batch file
Login
Here is a session screen scrape:<code>
[C:\Tmp]
> sqlite3_v3r33r0_patched furd.sdb
SQLite version 3.33.0 2020-08-14 13:23:32, except patched
  per https://www.sqlite.org/src/info/6c716f4b556ea8f9  .
Enter ".help" for usage hints.
sqlite> .read '| oschema.cmd'
CREATE TABLE Dummy(id int primary key);
CREATE TABLE People (
    id       INTEGER PRIMARY KEY,
    fname    TEXT,
    lname    TEXT,
    email    TEXT UNIQUE NOT NULL,
    password TEXT
  );
CREATE TABLE Config (
    name TEXT UNIQUE,
    value TEXT,
    validate TEXT
  );
CREATE VIEW DummyTagged as select p.id as id, p.fname||'Boy' as dname from People p, Dummy d where d.id=p.id/* DummyTagged(id,dname) */;
sqlite> .q

[C:\Tmp]
> type oschema.cmd
@echo off
echo .schema

[C:\Tmp]
>
</code>

Note the pipe character at the start of the single-quoted parameter to .read .

The amalgamation comes with a makefile which can be used thusly:<code>
  nmake -f Makefile.msc USE_CRT_DLL=1 OPTIMIZATIONS=3
</code>from a CLI shell (cmd.exe, unfortunately) which has had its environment setup by running one of the .bat files found in "%VCINSTALLDIR%\Auxiliary\Build". The choice among those .bat files determines your machine target.