# Zipvfs

Compiling And Using with System.Data.SQLite

# How To Compile And Use ZIPVFS with System.Data.SQLite

## 1.0 Introduction

This document explains how to compile an extended version of System.Data.SQLite that is able to read and write compressed database files using ZIPVFS.

## 2.0 Obtaining and Compiling zlib

The complete source code for zlib can be obtained from the official zlib project web site:

http://zlib.net/


In order to compile the zlib LIB for Win32, the following command can be used from a Visual Studio command prompt from within the zlib source code directory:

NMAKE /f win32\Makefile.msc zlib.lib


## 3.0 Compiling System.Data.SQLite with ZIPVFS support for Win32

This section assumes that the System.Data.SQLite source code is present in a directory named "dotnet" that is a peer of the root ZIPVFS source code directory. This section also assumes that the zlib source code directory is accessible via a junction within the "src" ZIPVFS source code directory, created using commands similar to the following:

CD /D src


To build System.Data.SQLite with ZIPVFS, the following command can be used from a command prompt from within the root ZIPVFS source code directory:

..\dotnet\Externals\Eagle\bin\EagleShell.exe -file src\buildSds.eagle


## 4.0 Using System.Data.SQLite with ZIPVFS support

Opening a ZIPVFS database with System.Data.SQLite requires using a connection string similar to one of the following:

"Data Source=database.db;VfsName=zlib;ZipVfsVersion=v2;"

"FullUri=file:database.db?vfs=zipvfs&zv=zlib;ZipVfsVersion=v3;"