feat: Add command which writes a tar file's headers into a SQLite database index
This commit is contained in:
@@ -1,21 +1,43 @@
|
||||
package main
|
||||
|
||||
//go:generate sqlboiler sqlite3 -o ../../pkg/db/sqlite/models/metadata -c ../../configs/sqlboiler/metadata.toml
|
||||
//go:generate go-bindata -pkg metadata -o ../../pkg/db/sqlite/migrations/metadata/migrations.go ../../db/sqlite/migrations/metadata
|
||||
|
||||
import (
|
||||
"archive/tar"
|
||||
"bytes"
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/pojntfx/stfs/pkg/db/sqlite/migrations/metadata"
|
||||
models "github.com/pojntfx/stfs/pkg/db/sqlite/models/metadata"
|
||||
migrate "github.com/rubenv/sql-migrate"
|
||||
"github.com/volatiletech/sqlboiler/v4/boil"
|
||||
)
|
||||
|
||||
//go:generate sqlboiler sqlite3 -o ../../pkg/db/sqlite/models/metadata -c ../../configs/sqlboiler/metadata.toml
|
||||
//go:generate go-bindata -pkg metadata -o ../../pkg/db/sqlite/migrations/metadata/migrations.go ../../db/sqlite/migrations/metadata
|
||||
const (
|
||||
blockSize = 512
|
||||
)
|
||||
|
||||
type HeaderInBlock struct {
|
||||
Record int
|
||||
Block int
|
||||
Header string
|
||||
}
|
||||
|
||||
func main() {
|
||||
dbPath := flag.String("db", "/tmp/stfs-metadata.sqlite", "Database file to use")
|
||||
file := flag.String("file", "/dev/nst0", "File (tape drive or tar file) to open")
|
||||
recordSize := flag.Int("recordSize", 20, "Amount of 512-bit blocks per record")
|
||||
checkpoint := flag.Int("checkpoint", 0, "Log current record after checkpoint kilobytes have been read")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -41,4 +63,89 @@ func main() {
|
||||
); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fileDescription, err := os.Stat(*file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
var f *os.File
|
||||
if fileDescription.Mode().IsRegular() {
|
||||
f, err = os.Open(*file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
f, err = os.OpenFile(*file, os.O_RDONLY, os.ModeCharDevice)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
record := 0
|
||||
for {
|
||||
// Lock the current record if requested
|
||||
if *checkpoint > 0 && record%*checkpoint == 0 {
|
||||
log.Println("Checkpoint:", record)
|
||||
}
|
||||
|
||||
// Read exactly one record
|
||||
bf := make([]byte, *recordSize*blockSize)
|
||||
if _, err := io.ReadFull(f, bf); err != nil {
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Get the headers from the record
|
||||
for i := 0; i < *recordSize; i++ {
|
||||
tr := tar.NewReader(bytes.NewReader(bf[blockSize*i : blockSize*(i+1)]))
|
||||
hdr, err := tr.Next()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if hdr.Format == tar.FormatUnknown {
|
||||
// EOF
|
||||
break
|
||||
}
|
||||
|
||||
paxRecords, err := json.Marshal(hdr.PAXRecords)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
dbhdr := &models.Header{
|
||||
Typeflag: int64(hdr.Typeflag),
|
||||
Name: hdr.Name,
|
||||
Linkname: hdr.Linkname,
|
||||
Size: hdr.Size,
|
||||
Mode: hdr.Mode,
|
||||
UID: int64(hdr.Uid),
|
||||
Gid: int64(hdr.Gid),
|
||||
Uname: hdr.Uname,
|
||||
Gname: hdr.Gname,
|
||||
Modtime: hdr.ModTime,
|
||||
Accesstime: hdr.AccessTime,
|
||||
Changetime: hdr.ChangeTime,
|
||||
Devmajor: hdr.Devmajor,
|
||||
Devminor: hdr.Devminor,
|
||||
Paxrecords: string(paxRecords),
|
||||
Format: int64(hdr.Format),
|
||||
Record: int64(record),
|
||||
Block: int64(i),
|
||||
}
|
||||
|
||||
if err := dbhdr.Insert(context.Background(), db, boil.Infer()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(dbhdr)
|
||||
}
|
||||
|
||||
record++
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,11 @@ create table headers (
|
||||
-- If the format is unspecified when Writer.WriteHeader is called,
|
||||
-- then it uses the first format (in the order of USTAR, PAX, GNU)
|
||||
-- capable of encoding this Header (see Format).
|
||||
format text not null
|
||||
format integer not null,
|
||||
-- The record on the tape
|
||||
record integer not null,
|
||||
-- The header's block in the record
|
||||
block integer not null
|
||||
);
|
||||
-- +migrate Down
|
||||
drop table headers;
|
||||
@@ -78,7 +78,7 @@ func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _bindataDbSqliteMigrationsMetadata1636892915Sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x56\x4d\x73\xdb\x36\x10\x3d\x8b\xbf\x62\x27\x97\xd8\x53\x49\xe7\x4e\x33\x3d\xb8\x71\xe3\x7a\xc6\x76\x32\xb2\x54\xe7\x0a\x01\x4b\x12\x15\x88\x45\x17\xa0\x64\xe6\xd7\x77\x16\x20\x6d\x29\xb5\xda\x69\x4f\x82\x88\xdd\x87\xb7\x5f\x0f\x58\x2c\xe0\x87\xce\x36\xac\x12\xc2\x26\x54\x9a\x51\x56\x49\x6d\x1d\x42\x8b\xca\x20\x47\xb8\xa8\x66\x8b\x05\xac\x87\x80\xb5\x53\x0d\xd8\x08\xa9\x45\x48\x43\x40\xa0\x7a\xb4\x02\xf4\x89\x87\x65\xb1\x6c\x11\xbe\x21\x13\xec\x95\xeb\x51\xec\x55\x9f\xa8\x53\xc9\x6a\xe5\xdc\x00\x81\xa9\xa3\x84\x06\x12\x01\xda\xd4\x22\x67\xf0\x15\x36\x40\x65\x79\x6d\x39\x23\x19\x0c\xe8\x8d\xf5\x0d\x90\xcf\x87\x06\xc6\x88\x5e\xe7\x83\x15\x24\x56\xd6\xc9\x6e\x74\x2a\xb6\x60\x3d\x3c\xa8\x0e\x97\xd5\x2c\xbd\x70\xf5\x09\x1b\x64\xf0\x94\xc0\xf7\xce\xcd\x33\xac\x58\x09\x42\x6d\x1d\x16\xe2\xd5\xcc\xcb\xb7\x84\xcf\xe9\xc5\x16\x02\xdb\x4e\xf1\x00\x3b\x1c\x8a\xdf\x5a\x71\x83\x09\xfc\xe8\xee\xac\xdf\xc1\xc5\x5e\x39\x6b\xa0\x1e\x99\xdf\xc9\xb7\x71\xfd\x38\x74\x62\x72\x59\xcd\xe4\xe7\xef\x07\x14\xd0\x3b\x6a\x24\x2f\x85\x4c\xb4\xdf\x50\xe2\xd8\x0e\x09\x63\x35\x1b\xff\xbe\x15\xc3\x17\xe4\xce\xc6\x68\xc9\x83\xf2\x06\x3a\x32\x08\x5b\x9b\x62\x35\xcb\xcb\xb7\x9d\x36\x11\x19\x6e\xaf\x85\x3c\x1d\x3c\x72\x35\xeb\xad\x39\x63\x7b\xc3\xd4\x87\x53\xe3\xe6\xac\x71\x06\x9e\xf2\x32\x41\x9f\x8b\xb8\x20\x7f\x67\xdd\x9c\xb3\xbe\xad\x73\xe5\x3f\x11\x77\x2a\x49\x33\xf5\x3e\x06\xd4\xb6\xb6\x68\xe6\xb2\xe5\xe1\x89\x6d\x42\x5e\xe6\x9f\xdf\x4a\x3b\x32\xf5\xde\x44\xb8\x27\xb3\xb6\x1d\x66\xa0\x44\x19\xc8\xa3\x62\x8c\x09\x22\x6a\xf2\x26\x27\xcf\x36\x9e\x18\x4b\x5b\x5f\x69\x8d\x31\x8a\x53\xde\xfa\xd8\x2a\xdf\x60\xfe\x5b\x5b\x74\x26\xe6\x16\x2f\xdd\x40\xd0\xc7\x13\x07\xe2\x23\xfb\x39\x14\x9a\xc3\x31\x7d\x15\xe1\xcb\xd5\x57\x31\xbc\x79\xd8\x2c\x8f\x61\x62\xbf\x5d\x8c\x94\x18\x23\xb9\x3e\x59\xf2\xff\x80\x51\x9c\xef\xc9\xd8\xda\x6a\x25\xc6\x90\x72\xa4\x1d\x19\x59\x80\x91\x41\x3e\x4d\x65\xa1\x9a\xed\xe0\x82\xf1\xcf\xde\x4a\xd4\xe3\x08\xbe\xf2\x82\xd8\x87\x40\x9c\x2e\xab\x99\xca\x1e\xe7\xf0\x4a\xb0\xff\x05\x4f\x67\x8f\x73\x78\xf7\xea\x0f\x62\x30\xb8\xb7\x1a\xc1\xf7\xdd\x16\xf9\xfb\xf9\xfa\xd8\x2a\x9e\xe6\xeb\x17\x47\x5a\xa6\xcb\xe0\xbe\xcb\x9e\x6f\xf7\xe6\xbd\xf5\xff\x17\x35\x7b\x9e\x99\xbf\xab\xaf\x2b\xd4\xc4\x26\x66\x81\x83\x4e\x05\xe9\x66\x89\x1a\x9f\x13\x7a\x83\x66\x92\x46\x2e\x76\xaf\x9d\x23\xd3\xb2\x30\x58\x5b\x8f\x66\xda\x85\xd8\x52\xef\x0c\xb4\x6a\x8f\xa2\x38\x51\xd0\xa4\xea\x35\x39\x47\x07\x51\xb9\x9a\xb8\xfb\x49\x00\x66\xbf\xff\xfa\x70\xfd\x79\xb5\xdc\xe1\x70\x20\x36\x19\xf3\xa9\x45\x46\x28\x1b\xc2\x28\x52\x87\x79\xc6\x62\x50\x3a\x6b\x8a\x72\x0e\xfa\x10\x90\xb5\x8a\x38\xcf\xdd\x3d\x02\x40\xa7\x86\x0c\x22\x21\x6a\xf2\x49\xd9\x22\xb7\xef\x7f\x7e\x0f\xba\x55\xac\x74\x92\xa4\xe1\xb2\x59\xce\xe1\xdd\xcd\xe7\xbb\xab\x87\x9b\x65\xd8\x35\xcb\x3d\xb2\x48\xd0\xbb\xcb\x57\xe5\xdf\xe1\x90\xb1\x8b\xf8\x8f\x51\x6d\xa5\xd4\x7e\x81\x5d\x48\x03\x6c\xd6\x9f\x16\x3f\x42\x4c\x6c\x7d\x73\x94\x95\xa7\x33\xa3\x6c\x23\xc8\xbd\x21\xd3\x2e\xd9\x9d\xf2\x65\x90\xed\x1e\x0d\xd4\x4c\x9d\x90\xcd\x18\x94\x5b\xaf\x4c\xaa\xc4\x3c\x42\x24\xb5\xcb\x77\x87\x46\x53\x6e\x8f\x7d\x69\xd0\xd5\x4b\x65\x82\x7a\x9e\x80\xdf\xd0\xa0\x71\xf2\x26\xdd\x89\x63\x61\xf2\xc7\xb1\x4c\x49\xf1\x58\xef\x23\x85\x68\x6d\xee\x8e\x88\x09\xb6\x03\xac\xca\xf6\x83\xe0\x2b\xe9\x99\x2d\xc6\xb4\xc0\xba\x26\x4e\xd0\xf4\x32\x9a\x2a\x1d\x41\x97\x9c\x3e\x5a\x61\x2c\x5f\x8b\x3f\x38\xbb\x45\xce\x17\x29\xa3\x32\x53\xa5\xc9\x2f\x34\x75\xc1\x59\xe5\x53\xbe\x4b\x62\xa1\x6e\xb3\x66\x06\x8a\xd1\xca\x9d\x2e\x1d\x9f\x84\x56\x22\x29\x4a\x09\x6c\xe3\x77\x9e\x0e\xfe\x95\xf8\x6d\x7d\x1c\xe1\xa9\xe6\xc2\xe1\x5f\xeb\x54\xe4\x56\xcc\x6c\x12\x71\x1b\xf3\x65\x39\xa6\x09\xf3\x62\xec\x30\x62\x71\xa5\x1a\x36\x8f\xeb\xab\x55\xae\xf0\x5c\x34\xe3\x32\x63\x68\x15\xf2\x4b\x84\x6a\x40\xaf\x29\xbf\x04\x32\xfb\xf1\xc8\x8b\x88\x53\x0c\xd2\x81\x23\xf6\x49\x01\xab\xcb\x0f\xd5\xf1\x23\xe7\x9a\x0e\xbe\x32\x4c\xe1\xf4\x91\xf3\xe1\xaf\x00\x00\x00\xff\xff\xd0\x35\xad\x6a\x09\x09\x00\x00")
|
||||
var _bindataDbSqliteMigrationsMetadata1636892915Sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x56\x4d\x73\xdb\x36\x10\x3d\x93\xbf\x62\x27\x97\xd8\x53\x49\xe7\x4e\x33\x3d\xb8\x71\xe3\x66\x26\x76\x32\xb2\x55\xe7\x0a\x11\x4b\x12\x15\x89\x45\x17\x4b\xc9\xcc\xaf\xef\x2c\x40\xda\x52\x6a\xb5\xd3\x9e\x04\x01\xbb\x8f\x6f\xbf\x1e\xb0\x5c\xc2\x0f\xbd\x6b\xd8\x08\xc2\x26\x94\x15\xa3\xae\xc4\x6c\x3b\x84\x16\x8d\x45\x8e\x70\x51\x16\xcb\x25\x3c\x8c\x01\xeb\xce\x34\xe0\x22\x48\x8b\x20\x63\x40\xa0\x7a\xb2\x02\xf4\xc2\xe3\x2a\x5b\xb6\x08\xdf\x90\x09\xf6\xa6\x1b\x50\xed\xcd\x20\xd4\x1b\x71\x95\xe9\xba\x11\x02\x53\x4f\x82\x16\x84\x00\x9d\xb4\xc8\x09\x7c\x8d\x0d\x50\x5e\x5e\x3b\x4e\x48\x16\x03\x7a\xeb\x7c\x03\xe4\xd3\x47\x03\x63\x44\x5f\xa5\x0f\x1b\x10\x36\xae\xd3\xd3\xd8\x99\xd8\x82\xf3\x70\x67\x7a\x5c\x95\x85\x3c\x73\xf5\x82\x0d\x32\x78\x12\xf0\x43\xd7\x2d\x12\xac\x5a\x29\x42\xed\x3a\xcc\xc4\xcb\xc2\xeb\x9e\xe0\x93\x3c\xdb\x42\x60\xd7\x1b\x1e\x61\x87\x63\xf6\x7b\x30\xdc\xa0\x80\x9f\xdc\x3b\xe7\x77\x70\xb1\x37\x9d\xb3\x50\x4f\xcc\x3f\xe9\xde\xb4\xbe\x1f\x7b\x35\xb9\x2c\x0b\xfd\xf9\xfb\x07\x32\xe8\x27\x6a\x34\x2f\x99\x4c\x74\xdf\x50\xe3\xd8\x8e\x82\xb1\x2c\xa6\xbf\xaf\xc5\xf0\x05\xb9\x77\x31\x3a\xf2\x60\xbc\x85\x9e\x2c\xc2\xd6\x49\x2c\x8b\xb4\x7c\xdd\x69\x13\x91\xe1\xe3\xb5\x92\xa7\x83\x47\x2e\x8b\xc1\xd9\x33\xb6\x37\x4c\x43\x38\x35\x6e\xce\x1a\x27\xe0\x39\x2f\x33\xf4\xb9\x88\x33\xf2\x77\xd6\xcd\x39\xeb\x8f\x75\xaa\xfc\x07\xe2\xde\x88\x36\xd3\xe0\x63\xc0\xca\xd5\x0e\xed\x42\x8f\x3c\x3c\xb2\x13\xe4\x55\xfa\xf9\x2d\xb7\x23\xd3\xe0\x6d\x84\x5b\xb2\x0f\xae\xc7\x04\x24\x94\x80\x3c\x1a\xc6\x28\x10\xb1\x22\x6f\x53\xf2\x5c\xe3\x89\x31\xb7\xf5\x55\x55\x61\x8c\xea\x94\x8e\xde\xb7\xc6\x37\x98\xfe\xd6\x0e\x3b\x1b\x53\x8b\xe7\x6e\x20\x18\xe2\x89\x03\xf1\x91\xfd\x02\x32\xcd\xf1\x98\xbe\x89\xf0\xe5\xea\xab\x1a\xde\xdc\x6d\x56\xc7\x30\x71\xd8\x2e\x27\x4a\x8c\x91\xba\x41\x1c\xf9\x7f\xc0\xc8\xce\xb7\x64\x5d\xed\x2a\xa3\xc6\x20\x29\xd2\x9e\xac\x2e\xc0\xea\x20\x9f\xa6\x32\x53\x4d\x76\x70\xc1\xf8\xe7\xe0\x34\xea\x69\x04\x5f\x78\x41\x1c\x42\x20\x96\xcb\xb2\x30\xc9\xe3\x1c\x5e\x0e\xf6\xbf\xe0\x55\xc9\xe3\x1c\xde\xad\xf9\x83\x18\x2c\xee\x5d\x85\xe0\x87\x7e\x8b\xfc\xfd\x7c\xbd\x6f\x0d\xcf\xf3\xf5\x4b\x47\x95\x4e\x97\xc5\x7d\x9f\x3c\x5f\xef\xcd\x5b\xe7\xff\x2f\x6a\xf2\x3c\x33\x7f\x57\x5f\xd7\x58\x11\xdb\x98\x04\x0e\x7a\x13\xb4\x9b\x35\x6a\x7c\x12\xf4\x16\xed\x2c\x8d\x9c\xed\x5e\x3a\x47\xa7\x65\x69\xb1\x76\x1e\xed\x7c\x0a\xb1\xa5\xa1\xb3\xd0\x9a\x3d\xaa\xe2\x44\x45\xd3\xaa\xd7\xd4\x75\x74\x50\x95\xab\x89\xfb\x9f\x14\xa0\xf8\xfd\xd7\xbb\xeb\xcf\xeb\xd5\x0e\xc7\x03\xb1\x4d\x98\x8f\x2d\x32\x42\x3e\x50\x46\x91\x7a\x4c\x33\x16\x83\xa9\x92\xa6\x98\xae\x83\x21\x04\xe4\xca\x44\x5c\xa4\xee\x9e\x00\xa0\x37\x63\x02\xd1\x10\x2b\xf2\x62\x5c\x96\xdb\xb7\x3f\xbf\x85\xaa\x35\x6c\x2a\xd1\xa4\xe1\xaa\x59\x2d\xe0\xcd\xcd\xe7\x4f\x57\x77\x37\xab\xb0\x6b\x56\x7b\x64\x95\xa0\x37\x97\x2f\xca\xbf\xc3\x31\x61\x67\xf1\x9f\xa2\xda\x6a\xa9\xfd\x12\xfb\x20\x23\x6c\x1e\x3e\x2c\x7f\x84\x28\xec\x7c\x73\x94\x95\xc7\x33\xa3\xec\x22\xe8\xbd\xa1\xd3\xae\xd9\x9d\xf3\x65\x91\xdd\x1e\x2d\xd4\x4c\xbd\x92\x4d\x18\x94\x5a\x2f\x4f\xaa\xc6\x3c\x41\x88\xd9\xa5\xbb\xa3\x42\x9b\x6f\x8f\x7d\x6e\xd0\xf5\x73\x65\x82\x79\x9a\x81\x5f\xd1\xa0\x69\xf2\x66\xdd\x89\x53\x61\xd2\xe6\x54\x26\x31\x3c\xd5\xfb\x48\x21\x5a\x97\xba\x23\xa2\xc0\x76\x84\x75\x3e\xbe\x53\x7c\xa3\x3d\xb3\xc5\x28\x4b\xac\x6b\x62\x81\x66\xd0\xd1\x34\x72\x04\x9d\x73\x7a\xef\x94\xb1\xee\x66\x7f\xe8\xdc\x16\x39\x5d\xa4\x8c\xc6\xce\x95\x26\xbf\xac\xa8\x0f\x9d\x33\x5e\xd2\x5d\x12\x33\x75\x97\x34\x33\x50\x8c\x4e\xef\x74\xed\x78\x51\x5a\x42\x5a\x94\x1c\xd8\xc6\xef\x3c\x1d\xfc\x0b\xf1\x8f\xf5\x71\x84\xa7\x9a\x0b\x87\x7f\xad\x53\x96\x5b\x35\x73\xa2\xe2\x36\xe5\xcb\x71\x94\x19\xf3\x62\xea\x30\x62\x75\xa5\x1a\x36\xf7\x0f\x57\xeb\x54\xe1\x85\x6a\xc6\x65\xc2\xa8\x4c\x48\x2f\x11\xaa\x01\x7d\x45\xe9\x25\x90\xd8\x4f\x9f\xbc\x88\x38\xc7\xa0\x1d\x38\xf3\x7d\x75\x60\xb5\x37\x73\x89\xe7\xc7\x84\x98\x80\x65\x31\xed\x9d\x77\xca\x55\x7d\x1b\x61\xab\xca\x00\x13\xf1\xec\x56\x16\xf3\xe6\xa9\x77\x79\xf9\xae\x3c\x7e\x5a\x5d\xd3\xc1\x97\x96\x29\x9c\x3e\xad\xde\xfd\x15\x00\x00\xff\xff\xa8\x19\x83\xb5\x7f\x09\x00\x00")
|
||||
|
||||
func bindataDbSqliteMigrationsMetadata1636892915SqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -97,10 +97,10 @@ func bindataDbSqliteMigrationsMetadata1636892915Sql() (*asset, error) {
|
||||
|
||||
info := bindataFileInfo{
|
||||
name: "../../db/sqlite/migrations/metadata/1636892915.sql",
|
||||
size: 2313,
|
||||
size: 2431,
|
||||
md5checksum: "",
|
||||
mode: os.FileMode(420),
|
||||
modTime: time.Unix(1636894164, 0),
|
||||
modTime: time.Unix(1636898047, 0),
|
||||
}
|
||||
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
|
||||
@@ -37,7 +37,9 @@ type Header struct {
|
||||
Devmajor int64 `boil:"devmajor" json:"devmajor" toml:"devmajor" yaml:"devmajor"`
|
||||
Devminor int64 `boil:"devminor" json:"devminor" toml:"devminor" yaml:"devminor"`
|
||||
Paxrecords string `boil:"paxrecords" json:"paxrecords" toml:"paxrecords" yaml:"paxrecords"`
|
||||
Format string `boil:"format" json:"format" toml:"format" yaml:"format"`
|
||||
Format int64 `boil:"format" json:"format" toml:"format" yaml:"format"`
|
||||
Record int64 `boil:"record" json:"record" toml:"record" yaml:"record"`
|
||||
Block int64 `boil:"block" json:"block" toml:"block" yaml:"block"`
|
||||
|
||||
R *headerR `boil:"-" json:"-" toml:"-" yaml:"-"`
|
||||
L headerL `boil:"-" json:"-" toml:"-" yaml:"-"`
|
||||
@@ -60,6 +62,8 @@ var HeaderColumns = struct {
|
||||
Devminor string
|
||||
Paxrecords string
|
||||
Format string
|
||||
Record string
|
||||
Block string
|
||||
}{
|
||||
Typeflag: "typeflag",
|
||||
Name: "name",
|
||||
@@ -77,6 +81,8 @@ var HeaderColumns = struct {
|
||||
Devminor: "devminor",
|
||||
Paxrecords: "paxrecords",
|
||||
Format: "format",
|
||||
Record: "record",
|
||||
Block: "block",
|
||||
}
|
||||
|
||||
var HeaderTableColumns = struct {
|
||||
@@ -96,6 +102,8 @@ var HeaderTableColumns = struct {
|
||||
Devminor string
|
||||
Paxrecords string
|
||||
Format string
|
||||
Record string
|
||||
Block string
|
||||
}{
|
||||
Typeflag: "headers.typeflag",
|
||||
Name: "headers.name",
|
||||
@@ -113,6 +121,8 @@ var HeaderTableColumns = struct {
|
||||
Devminor: "headers.devminor",
|
||||
Paxrecords: "headers.paxrecords",
|
||||
Format: "headers.format",
|
||||
Record: "headers.record",
|
||||
Block: "headers.block",
|
||||
}
|
||||
|
||||
// Generated where
|
||||
@@ -177,7 +187,9 @@ var HeaderWhere = struct {
|
||||
Devmajor whereHelperint64
|
||||
Devminor whereHelperint64
|
||||
Paxrecords whereHelperstring
|
||||
Format whereHelperstring
|
||||
Format whereHelperint64
|
||||
Record whereHelperint64
|
||||
Block whereHelperint64
|
||||
}{
|
||||
Typeflag: whereHelperint64{field: "\"headers\".\"typeflag\""},
|
||||
Name: whereHelperstring{field: "\"headers\".\"name\""},
|
||||
@@ -194,7 +206,9 @@ var HeaderWhere = struct {
|
||||
Devmajor: whereHelperint64{field: "\"headers\".\"devmajor\""},
|
||||
Devminor: whereHelperint64{field: "\"headers\".\"devminor\""},
|
||||
Paxrecords: whereHelperstring{field: "\"headers\".\"paxrecords\""},
|
||||
Format: whereHelperstring{field: "\"headers\".\"format\""},
|
||||
Format: whereHelperint64{field: "\"headers\".\"format\""},
|
||||
Record: whereHelperint64{field: "\"headers\".\"record\""},
|
||||
Block: whereHelperint64{field: "\"headers\".\"block\""},
|
||||
}
|
||||
|
||||
// HeaderRels is where relationship names are stored.
|
||||
@@ -214,8 +228,8 @@ func (*headerR) NewStruct() *headerR {
|
||||
type headerL struct{}
|
||||
|
||||
var (
|
||||
headerAllColumns = []string{"typeflag", "name", "linkname", "size", "mode", "uid", "gid", "uname", "gname", "modtime", "accesstime", "changetime", "devmajor", "devminor", "paxrecords", "format"}
|
||||
headerColumnsWithoutDefault = []string{"typeflag", "name", "linkname", "size", "mode", "uid", "gid", "uname", "gname", "modtime", "accesstime", "changetime", "devmajor", "devminor", "paxrecords", "format"}
|
||||
headerAllColumns = []string{"typeflag", "name", "linkname", "size", "mode", "uid", "gid", "uname", "gname", "modtime", "accesstime", "changetime", "devmajor", "devminor", "paxrecords", "format", "record", "block"}
|
||||
headerColumnsWithoutDefault = []string{"typeflag", "name", "linkname", "size", "mode", "uid", "gid", "uname", "gname", "modtime", "accesstime", "changetime", "devmajor", "devminor", "paxrecords", "format", "record", "block"}
|
||||
headerColumnsWithDefault = []string{}
|
||||
headerPrimaryKeyColumns = []string{"name"}
|
||||
)
|
||||
|
||||
@@ -568,7 +568,7 @@ func testHeadersSelect(t *testing.T) {
|
||||
}
|
||||
|
||||
var (
|
||||
headerDBTypes = map[string]string{`Typeflag`: `INTEGER`, `Name`: `TEXT`, `Linkname`: `TEXT`, `Size`: `INTEGER`, `Mode`: `INTEGER`, `UID`: `INTEGER`, `Gid`: `INTEGER`, `Uname`: `TEXT`, `Gname`: `TEXT`, `Modtime`: `DATE`, `Accesstime`: `DATE`, `Changetime`: `DATE`, `Devmajor`: `INTEGER`, `Devminor`: `INTEGER`, `Paxrecords`: `TEXT`, `Format`: `TEXT`}
|
||||
headerDBTypes = map[string]string{`Typeflag`: `INTEGER`, `Name`: `TEXT`, `Linkname`: `TEXT`, `Size`: `INTEGER`, `Mode`: `INTEGER`, `UID`: `INTEGER`, `Gid`: `INTEGER`, `Uname`: `TEXT`, `Gname`: `TEXT`, `Modtime`: `DATE`, `Accesstime`: `DATE`, `Changetime`: `DATE`, `Devmajor`: `INTEGER`, `Devminor`: `INTEGER`, `Paxrecords`: `TEXT`, `Format`: `INTEGER`, `Record`: `INTEGER`, `Block`: `INTEGER`}
|
||||
_ = bytes.MinRead
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user