It is not clear what level of zlib compression is used in sqlar. Does
anybody know?

https://sqlite.org/sqlar/doc/trunk/README.md

Is the following python code guarantee to generate a file that conform
to the sqlar format standard? (Note that I deliberately set the
timestamp and permission to zero as I don't care about them.)

```
import sqlite3
conn=sqlite3.connect(sys.argv[1])
c=conn.cursor()
import zlib
data = sys.stdin.read()
c.execute('REPLACE INTO sqlar VALUES(?, ?, ?, ?, ?)', [sys.argv[2], 0,
0, len(data), buffer(zlib.compress(data))])
conn.commit()
```

The content is taken from stdin and the sqlar file is in argv[1] and
the path in the archive is in argv[2].

-- 
Regards,
Peng
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to