1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815
|
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Virtual File System (VFS) — APSW 3.46.0.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=72bcf2f2" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/apsw.css?v=3c7e2631" />
<link rel="shortcut icon" href="_static/favicon.ico"/>
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=d98f5d2b"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="next" title="Shell" href="shell.html" />
<link rel="prev" title="Virtual Tables" href="vtable.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
APSW
<img src="_static/apswlogo.png" class="logo" alt="Logo"/>
</a>
<div class="version">
3.46.0.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="about.html">About</a></li>
<li class="toctree-l1"><a class="reference internal" href="tips.html">Tips</a></li>
<li class="toctree-l1"><a class="reference internal" href="example.html">Example/Tour</a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation and customization</a></li>
<li class="toctree-l1"><a class="reference internal" href="extensions.html">Extensions</a></li>
<li class="toctree-l1"><a class="reference internal" href="apsw.html">APSW Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="connection.html">Connections to a database</a></li>
<li class="toctree-l1"><a class="reference internal" href="cursor.html">Cursors (executing SQL)</a></li>
<li class="toctree-l1"><a class="reference internal" href="blob.html">Blob Input/Output</a></li>
<li class="toctree-l1"><a class="reference internal" href="backup.html">Backup</a></li>
<li class="toctree-l1"><a class="reference internal" href="vtable.html">Virtual Tables</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Virtual File System (VFS)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#exceptions-and-errors">Exceptions and errors</a></li>
<li class="toctree-l2"><a class="reference internal" href="#vfsfcntlpragma-class">VFSFcntlPragma class</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apsw.VFSFcntlPragma"><code class="docutils literal notranslate"><span class="pre">VFSFcntlPragma</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFcntlPragma.name"><code class="docutils literal notranslate"><span class="pre">VFSFcntlPragma.name</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFcntlPragma.result"><code class="docutils literal notranslate"><span class="pre">VFSFcntlPragma.result</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFcntlPragma.value"><code class="docutils literal notranslate"><span class="pre">VFSFcntlPragma.value</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#vfs-class">VFS class</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apsw.VFS"><code class="docutils literal notranslate"><span class="pre">VFS</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.excepthook"><code class="docutils literal notranslate"><span class="pre">VFS.excepthook()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.unregister"><code class="docutils literal notranslate"><span class="pre">VFS.unregister()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xAccess"><code class="docutils literal notranslate"><span class="pre">VFS.xAccess()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xCurrentTime"><code class="docutils literal notranslate"><span class="pre">VFS.xCurrentTime()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xCurrentTimeInt64"><code class="docutils literal notranslate"><span class="pre">VFS.xCurrentTimeInt64()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xDelete"><code class="docutils literal notranslate"><span class="pre">VFS.xDelete()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xDlClose"><code class="docutils literal notranslate"><span class="pre">VFS.xDlClose()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xDlError"><code class="docutils literal notranslate"><span class="pre">VFS.xDlError()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xDlOpen"><code class="docutils literal notranslate"><span class="pre">VFS.xDlOpen()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xDlSym"><code class="docutils literal notranslate"><span class="pre">VFS.xDlSym()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xFullPathname"><code class="docutils literal notranslate"><span class="pre">VFS.xFullPathname()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xGetLastError"><code class="docutils literal notranslate"><span class="pre">VFS.xGetLastError()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xGetSystemCall"><code class="docutils literal notranslate"><span class="pre">VFS.xGetSystemCall()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xNextSystemCall"><code class="docutils literal notranslate"><span class="pre">VFS.xNextSystemCall()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xOpen"><code class="docutils literal notranslate"><span class="pre">VFS.xOpen()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xRandomness"><code class="docutils literal notranslate"><span class="pre">VFS.xRandomness()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xSetSystemCall"><code class="docutils literal notranslate"><span class="pre">VFS.xSetSystemCall()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFS.xSleep"><code class="docutils literal notranslate"><span class="pre">VFS.xSleep()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#vfsfile-class">VFSFile class</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apsw.VFSFile"><code class="docutils literal notranslate"><span class="pre">VFSFile</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.excepthook"><code class="docutils literal notranslate"><span class="pre">VFSFile.excepthook()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xCheckReservedLock"><code class="docutils literal notranslate"><span class="pre">VFSFile.xCheckReservedLock()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xClose"><code class="docutils literal notranslate"><span class="pre">VFSFile.xClose()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xDeviceCharacteristics"><code class="docutils literal notranslate"><span class="pre">VFSFile.xDeviceCharacteristics()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xFileControl"><code class="docutils literal notranslate"><span class="pre">VFSFile.xFileControl()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xFileSize"><code class="docutils literal notranslate"><span class="pre">VFSFile.xFileSize()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xLock"><code class="docutils literal notranslate"><span class="pre">VFSFile.xLock()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xRead"><code class="docutils literal notranslate"><span class="pre">VFSFile.xRead()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xSectorSize"><code class="docutils literal notranslate"><span class="pre">VFSFile.xSectorSize()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xSync"><code class="docutils literal notranslate"><span class="pre">VFSFile.xSync()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xTruncate"><code class="docutils literal notranslate"><span class="pre">VFSFile.xTruncate()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xUnlock"><code class="docutils literal notranslate"><span class="pre">VFSFile.xUnlock()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.VFSFile.xWrite"><code class="docutils literal notranslate"><span class="pre">VFSFile.xWrite()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#urifilename-class">URIFilename class</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apsw.URIFilename"><code class="docutils literal notranslate"><span class="pre">URIFilename</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="#apsw.URIFilename.filename"><code class="docutils literal notranslate"><span class="pre">URIFilename.filename()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.URIFilename.parameters"><code class="docutils literal notranslate"><span class="pre">URIFilename.parameters</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.URIFilename.uri_boolean"><code class="docutils literal notranslate"><span class="pre">URIFilename.uri_boolean()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.URIFilename.uri_int"><code class="docutils literal notranslate"><span class="pre">URIFilename.uri_int()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apsw.URIFilename.uri_parameter"><code class="docutils literal notranslate"><span class="pre">URIFilename.uri_parameter()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="shell.html">Shell</a></li>
<li class="toctree-l1"><a class="reference internal" href="bestpractice.html">Best Practice</a></li>
<li class="toctree-l1"><a class="reference internal" href="ext.html">Various interesting and useful bits of functionality</a></li>
<li class="toctree-l1"><a class="reference internal" href="exceptions.html">Exceptions and Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="execution.html">Execution and tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="dbapi.html">DBAPI notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="pysqlite.html">sqlite3 module differences</a></li>
<li class="toctree-l1"><a class="reference internal" href="benchmarking.html">Benchmarking</a></li>
<li class="toctree-l1"><a class="reference internal" href="copyright.html">Copyright and License</a></li>
<li class="toctree-l1"><a class="reference internal" href="changes.html">Change History</a></li>
<li class="toctree-l1"><a class="reference internal" href="py-modindex.html">Module Index</a></li>
<li class="toctree-l1"><a class="reference internal" href="genindex.html">Index</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">APSW</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content style-external-links">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Virtual File System (VFS)</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/vfs.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="Sequential page navigation">
<a href="vtable.html" class="btn btn-neutral float-left" title="Virtual Tables" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="shell.html" class="btn btn-neutral float-right" title="Shell" accesskey="n">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="virtual-file-system-vfs">
<span id="vfs"></span><h1>Virtual File System (VFS)<a class="headerlink" href="#virtual-file-system-vfs" title="Link to this heading"></a></h1>
<p><a class="reference external" href="https://sqlite.org/c3ref/vfs.html">VFS</a> defines
the interface between the SQLite core and the underlying operating
system. The majority of the functionality deals with files. APSW
exposes this functionality letting you provide your own routines.
You can also <em>inherit</em> from an existing vfs making it easy to augment
or override specific routines.</p>
<p>You specify which VFS to use as a parameter to the <a class="reference internal" href="connection.html#apsw.Connection" title="apsw.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a>
constructor.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">db</span><span class="o">=</span><span class="n">apsw</span><span class="o">.</span><span class="n">Connection</span><span class="p">(</span><span class="s2">"file"</span><span class="p">,</span> <span class="n">vfs</span><span class="o">=</span><span class="s2">"myvfs"</span><span class="p">)</span>
</pre></div>
</div>
<p>The easiest way to get started is to make a <a class="reference internal" href="#apsw.VFS" title="apsw.VFS"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFS</span></code></a> derived class
that inherits from the default vfs. Then override methods you want to
change behaviour of. If you want to just change how file operations
are done then you have to override <a class="reference internal" href="#apsw.VFS.xOpen" title="apsw.VFS.xOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VFS.xOpen()</span></code></a> to return a file
instance that has your overridden <a class="reference internal" href="#apsw.VFSFile" title="apsw.VFSFile"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFSFile</span></code></a> methods. The
<a class="reference internal" href="example.html#example-vfs"><span class="std std-ref">example</span></a> demonstrates obfuscating the database
file contents.</p>
<section id="exceptions-and-errors">
<h2>Exceptions and errors<a class="headerlink" href="#exceptions-and-errors" title="Link to this heading"></a></h2>
<p>To return an error from any routine you should raise an exception. The
exception will be translated into the corresponding SQLite error code.
To return a specific SQLite error code use <a class="reference internal" href="apsw.html#apsw.exception_for" title="apsw.exception_for"><code class="xref py py-meth docutils literal notranslate"><span class="pre">exception_for()</span></code></a>. If
the exception does not map to any specific error code then
<em>SQLITE_ERROR</em> which corresponds to <a class="reference internal" href="exceptions.html#apsw.SQLError" title="apsw.SQLError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">SQLError</span></code></a> is returned to SQLite.</p>
<p>The SQLite code that deals with VFS errors behaves in varying
ways. Some routines have no way to return an error: eg <a class="reference external" href="https://sqlite.org/c3ref/vfs.html">xDlOpen</a> just returns zero/NULL on
being unable to load a library, <a class="reference external" href="https://sqlite.org/c3ref/vfs.html">xSleep</a> has no error return
parameter), others are unified (eg almost any
error in xWrite will be returned to the user as disk full
error). Sometimes errors are ignored as they are harmless such as when
a journal can’t be deleted after a commit (the journal is marked as
obsolete before being deleted). Simple operations such as opening a
database can result in many different VFS function calls such as hot
journals being detected, locking, and read/writes for
playback/rollback.</p>
<p>If multiple exceptions occur during the same SQLite control flow, then
they will be <a class="reference internal" href="exceptions.html"><span class="doc">chained</span></a> together.
<a class="reference internal" href="exceptions.html#augmentedstacktraces"><span class="std std-ref">Augmented stack traces</span></a> are available
which significantly increase detail about the exceptions and help with
debugging.</p>
</section>
<section id="vfsfcntlpragma-class">
<h2>VFSFcntlPragma class<a class="headerlink" href="#vfsfcntlpragma-class" title="Link to this heading"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="apsw.VFSFcntlPragma">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apsw.</span></span><span class="sig-name descname"><span class="pre">VFSFcntlPragma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pointer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#apsw.VFSFcntlPragma" title="Link to this definition"></a></dt>
<dd></dd></dl>
<p>A helper class to work with <a class="reference external" href="https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlpragma">SQLITE_FCNTL_PRAGMA</a>
in <a class="reference internal" href="#apsw.VFSFile.xFileControl" title="apsw.VFSFile.xFileControl"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VFSFile.xFileControl()</span></code></a>. The <a class="reference internal" href="example.html#example-vfs"><span class="std std-ref">example</span></a>
shows usage of this class.</p>
<p>It is only valid while in <a class="reference internal" href="#apsw.VFSFile.xFileControl" title="apsw.VFSFile.xFileControl"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VFSFile.xFileControl()</span></code></a>, and using
outside of that will result in memory corruption and crashes.</p>
<p>The pointer must be what your xFileControl method received.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="apsw.VFSFcntlPragma.name">
<span class="sig-prename descclassname"><span class="pre">VFSFcntlPragma.</span></span><span class="sig-name descname"><span class="pre">name</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="headerlink" href="#apsw.VFSFcntlPragma.name" title="Link to this definition"></a></dt>
<dd><p>The name of the pragma</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="apsw.VFSFcntlPragma.result">
<span class="sig-prename descclassname"><span class="pre">VFSFcntlPragma.</span></span><span class="sig-name descname"><span class="pre">result</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></em><a class="headerlink" href="#apsw.VFSFcntlPragma.result" title="Link to this definition"></a></dt>
<dd><p>The first element which becomes the result or error message</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="apsw.VFSFcntlPragma.value">
<span class="sig-prename descclassname"><span class="pre">VFSFcntlPragma.</span></span><span class="sig-name descname"><span class="pre">value</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></em><a class="headerlink" href="#apsw.VFSFcntlPragma.value" title="Link to this definition"></a></dt>
<dd><p>The value for the pragma, if provided else None,</p>
</dd></dl>
</section>
<section id="vfs-class">
<h2>VFS class<a class="headerlink" href="#vfs-class" title="Link to this heading"></a></h2>
<dl class="py class" id="index-0">
<dt class="sig sig-object py" id="apsw.VFS">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apsw.</span></span><span class="sig-name descname"><span class="pre">VFS</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">base</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">makedefault</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maxpathname</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1024</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iVersion</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.12)"><span class="pre">set</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#apsw.VFS" title="Link to this definition"></a></dt>
<dd><p>Provides operating system access. You can get an overview in the
<a class="reference external" href="https://sqlite.org/c3ref/vfs.html">SQLite documentation</a>. To
create a VFS your Python class must inherit from <a class="reference internal" href="#apsw.VFS" title="apsw.VFS"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFS</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> – The name to register this vfs under. If the name
already exists then this vfs will replace the prior one of the
same name. Use <a class="reference internal" href="apsw.html#apsw.vfs_names" title="apsw.vfs_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">apsw.vfs_names()</span></code></a> to get a list of
registered vfs names.</p></li>
<li><p><strong>base</strong> – If you would like to inherit behaviour from an already registered vfs then give
their name. To inherit from the default vfs, use a zero
length string <code class="docutils literal notranslate"><span class="pre">""</span></code> as the name.</p></li>
<li><p><strong>makedefault</strong> – If true then this vfs will be registered as the default, and will be
used by any opens that don’t specify a vfs.</p></li>
<li><p><strong>maxpathname</strong> – The maximum length of database name in bytes when
represented in UTF-8. If a pathname is passed in longer than
this value then SQLite will not`be able to open it. If you are
using a base, then a value of zero will use the value from base.</p></li>
<li><p><strong>iVersion</strong> – Version number for the <a class="reference external" href="https://sqlite.org/c3ref/vfs.html">sqlite3_vfs</a>
structure.</p></li>
<li><p><strong>exclude</strong> – A set of strings, naming the methods that will be filled in with <code class="docutils literal notranslate"><span class="pre">NULL</span></code> in the <a class="reference external" href="https://sqlite.org/c3ref/vfs.html">sqlite3_vfs</a> structure to indicate to SQLite that they are
not supported.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Calls:</dt><dd><ul class="simple">
<li><p><a class="reference external" href="https://sqlite.org/c3ref/vfs_find.html">sqlite3_vfs_register</a></p></li>
<li><p><a class="reference external" href="https://sqlite.org/c3ref/vfs_find.html">sqlite3_vfs_find</a></p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.excepthook">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">excepthook</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">etype</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.12)"><span class="pre">type</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#BaseException" title="(in Python v3.12)"><span class="pre">BaseException</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evalue</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#BaseException" title="(in Python v3.12)"><span class="pre">BaseException</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">etraceback</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/types.html#types.TracebackType" title="(in Python v3.12)"><span class="pre">types.TracebackType</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Any</span></span></span><a class="headerlink" href="#apsw.VFS.excepthook" title="Link to this definition"></a></dt>
<dd><p>Called when there has been an exception in a <a class="reference internal" href="#apsw.VFS" title="apsw.VFS"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFS</span></code></a> routine,
and it can’t be reported to the caller as usual.</p>
<p>The default implementation passes the exception information
to sqlite3_log, and the first non-error of
<a class="reference external" href="https://docs.python.org/3/library/sys.html#sys.unraisablehook" title="(in Python v3.12)"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys.unraisablehook()</span></code></a> and <a class="reference external" href="https://docs.python.org/3/library/sys.html#sys.excepthook" title="(in Python v3.12)"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys.excepthook()</span></code></a>, falling back to
<cite>PyErr_Display</cite>.</p>
</dd></dl>
<dl class="py method" id="index-1">
<dt class="sig sig-object py" id="apsw.VFS.unregister">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">unregister</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFS.unregister" title="Link to this definition"></a></dt>
<dd><p>Unregisters the VFS making it unavailable to future database
opens. You do not need to call this as the VFS is automatically
unregistered by when the VFS has no more references or open
databases using it. It is however useful to call if you have made
your VFS be the default and wish to immediately make it be
unavailable. It is safe to call this routine multiple times.</p>
<p>Calls: <a class="reference external" href="https://sqlite.org/c3ref/vfs_find.html">sqlite3_vfs_unregister</a></p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xAccess">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xAccess</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pathname</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></span><a class="headerlink" href="#apsw.VFS.xAccess" title="Link to this definition"></a></dt>
<dd><p>SQLite wants to check access permissions. Return True or False
accordingly.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pathname</strong> – File or directory to check</p></li>
<li><p><strong>flags</strong> – One of the <a class="reference external" href="https://sqlite.org/c3ref/c_access_exists.html">access flags</a></p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xCurrentTime">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xCurrentTime</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.12)"><span class="pre">float</span></a></span></span><a class="headerlink" href="#apsw.VFS.xCurrentTime" title="Link to this definition"></a></dt>
<dd><p>Return the <a class="reference external" href="https://en.wikipedia.org/wiki/Julian_day">Julian Day Number</a> as a floating point
number where the integer portion is the day and the fractional part
is the time.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xCurrentTimeInt64">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xCurrentTimeInt64</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.VFS.xCurrentTimeInt64" title="Link to this definition"></a></dt>
<dd><p>Returns as an integer the <a class="reference external" href="https://en.wikipedia.org/wiki/Julian_day">Julian Day Number</a> multiplied by 86400000
(the number of milliseconds in a 24-hour day).</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xDelete">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xDelete</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">syncdir</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFS.xDelete" title="Link to this definition"></a></dt>
<dd><p>Delete the named file. If the file is missing then raise an
<a class="reference internal" href="exceptions.html#apsw.IOError" title="apsw.IOError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">IOError</span></code></a> exception with extendedresult
<em>SQLITE_IOERR_DELETE_NOENT</em></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> – File to delete</p></li>
<li><p><strong>syncdir</strong> – If True then the directory should be synced
ensuring that the file deletion has been recorded on the disk
platters. ie if there was an immediate power failure after this
call returns, on a reboot the file would still be deleted.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xDlClose">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xDlClose</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handle</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFS.xDlClose" title="Link to this definition"></a></dt>
<dd><p>Close and unload the library corresponding to the handle you
returned from <a class="reference internal" href="#apsw.VFS.xDlOpen" title="apsw.VFS.xDlOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlOpen()</span></code></a>. You can use ctypes to do
this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">xDlClose</span><span class="p">(</span><span class="n">handle</span><span class="p">:</span> <span class="nb">int</span><span class="p">):</span>
<span class="c1"># Note leading underscore in _ctypes</span>
<span class="n">_ctypes</span><span class="o">.</span><span class="n">dlclose</span><span class="p">(</span><span class="n">handle</span><span class="p">)</span> <span class="c1"># Linux/Mac/Unix</span>
<span class="n">_ctypes</span><span class="o">.</span><span class="n">FreeLibrary</span><span class="p">(</span><span class="n">handle</span><span class="p">)</span> <span class="c1"># Windows</span>
</pre></div>
</div>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xDlError">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xDlError</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></span><a class="headerlink" href="#apsw.VFS.xDlError" title="Link to this definition"></a></dt>
<dd><p>Return an error string describing the last error of
<a class="reference internal" href="#apsw.VFS.xDlOpen" title="apsw.VFS.xDlOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlOpen()</span></code></a> or <a class="reference internal" href="#apsw.VFS.xDlSym" title="apsw.VFS.xDlSym"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlSym()</span></code></a> (ie they returned
zero/NULL). If you do not supply this routine then SQLite provides
a generic message. To implement this method, catch exceptions in
<a class="reference internal" href="#apsw.VFS.xDlOpen" title="apsw.VFS.xDlOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlOpen()</span></code></a> or <a class="reference internal" href="#apsw.VFS.xDlSym" title="apsw.VFS.xDlSym"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlSym()</span></code></a>, turn them into
strings, save them, and return them in this routine. If you have
an error in this routine or return None then SQLite’s generic
message will be used.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xDlOpen">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xDlOpen</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.VFS.xDlOpen" title="Link to this definition"></a></dt>
<dd><p>Load the shared library. You should return a number which will be
treated as a void pointer at the C level. On error you should
return 0 (NULL). The number is passed as is to
<a class="reference internal" href="#apsw.VFS.xDlSym" title="apsw.VFS.xDlSym"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlSym()</span></code></a>/<a class="reference internal" href="#apsw.VFS.xDlClose" title="apsw.VFS.xDlClose"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlClose()</span></code></a> so it can represent
anything that is convenient for you (eg an index into an
array). You can use ctypes to load a library:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">xDlOpen</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="k">return</span> <span class="n">ctypes</span><span class="o">.</span><span class="n">cdll</span><span class="o">.</span><span class="n">LoadLibrary</span><span class="p">(</span><span class="n">name</span><span class="p">)</span><span class="o">.</span><span class="n">_handle</span>
</pre></div>
</div>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xDlSym">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xDlSym</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handle</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">symbol</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.VFS.xDlSym" title="Link to this definition"></a></dt>
<dd><p>Returns the address of the named symbol which will be called by
SQLite. On error you should return 0 (NULL). You can use ctypes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">xDlSym</span><span class="p">(</span><span class="n">ptr</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="k">return</span> <span class="n">_ctypes</span><span class="o">.</span><span class="n">dlsym</span> <span class="p">(</span><span class="n">ptr</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="c1"># Linux/Unix/Mac etc (note leading underscore)</span>
<span class="k">return</span> <span class="n">ctypes</span><span class="o">.</span><span class="n">win32</span><span class="o">.</span><span class="n">kernel32</span><span class="o">.</span><span class="n">GetProcAddress</span> <span class="p">(</span><span class="n">ptr</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="c1"># Windows</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> – The value returned from an earlier <a class="reference internal" href="#apsw.VFS.xDlOpen" title="apsw.VFS.xDlOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">xDlOpen()</span></code></a> call</p></li>
<li><p><strong>symbol</strong> – A string</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xFullPathname">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xFullPathname</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></span><a class="headerlink" href="#apsw.VFS.xFullPathname" title="Link to this definition"></a></dt>
<dd><p>Return the absolute pathname for name. You can use <code class="docutils literal notranslate"><span class="pre">os.path.abspath</span></code> to do this.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xGetLastError">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xGetLastError</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.12)"><span class="pre">tuple</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#apsw.VFS.xGetLastError" title="Link to this definition"></a></dt>
<dd><p>Return an integer error code and (optional) text describing
the last error code and message that happened in this thread.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xGetSystemCall">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xGetSystemCall</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFS.xGetSystemCall" title="Link to this definition"></a></dt>
<dd><p>Returns a pointer for the current method implementing the named
system call. Return None if the call does not exist.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xNextSystemCall">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xNextSystemCall</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFS.xNextSystemCall" title="Link to this definition"></a></dt>
<dd><p>This method is repeatedly called to iterate over all of the system
calls in the vfs. When called with None you should return the
name of the first system call. In subsequent calls return the
name after the one passed in. If name is the last system call
then return None.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xOpen">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xOpen</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#apsw.URIFilename" title="apsw.URIFilename"><span class="pre">URIFilename</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.12)"><span class="pre">list</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#apsw.VFSFile" title="apsw.VFSFile"><span class="pre">VFSFile</span></a></span></span><a class="headerlink" href="#apsw.VFS.xOpen" title="Link to this definition"></a></dt>
<dd><p>This method should return a new file object based on name. You
can return a <a class="reference internal" href="#apsw.VFSFile" title="apsw.VFSFile"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFSFile</span></code></a> from a completely different VFS.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> – File to open. Note that <em>name</em> may be <em>None</em> in which
case you should open a temporary file with a name of your
choosing. May be an instance of <a class="reference internal" href="#apsw.URIFilename" title="apsw.URIFilename"><code class="xref py py-class docutils literal notranslate"><span class="pre">URIFilename</span></code></a>.</p></li>
<li><p><strong>flags</strong> – A list of two integers <code class="docutils literal notranslate"><span class="pre">[inputflags,</span>
<span class="pre">outputflags]</span></code>. Each integer is one or more of the <a class="reference external" href="https://sqlite.org/c3ref/c_open_autoproxy.html">open flags</a> binary orred
together. The <code class="docutils literal notranslate"><span class="pre">inputflags</span></code> tells you what SQLite wants. For
example <em>SQLITE_OPEN_DELETEONCLOSE</em> means the file should
be automatically deleted when closed. The <code class="docutils literal notranslate"><span class="pre">outputflags</span></code>
describes how you actually did open the file. For example if you
opened it read only then <em>SQLITE_OPEN_READONLY</em> should be
set.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xRandomness">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xRandomness</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">numbytes</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.12)"><span class="pre">bytes</span></a></span></span><a class="headerlink" href="#apsw.VFS.xRandomness" title="Link to this definition"></a></dt>
<dd><p>This method is called once on the default VFS when SQLite needs to
seed the random number generator. You can return less than the
number of bytes requested including None. If you return more then
the surplus is ignored.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xSetSystemCall">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xSetSystemCall</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">pointer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></span><a class="headerlink" href="#apsw.VFS.xSetSystemCall" title="Link to this definition"></a></dt>
<dd><p>Change a system call used by the VFS. This is useful for testing
and some other scenarios such as sandboxing.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> – The string name of the system call</p></li>
<li><p><strong>pointer</strong> – A pointer provided as an int. There is no
reference counting or other memory tracking of the pointer. If
you provide one you need to ensure it is around for the lifetime
of this and any other related VFS.</p></li>
</ul>
</dd>
</dl>
<p>Raise an exception to return an error. If the system call does
not exist then raise <a class="reference internal" href="exceptions.html#apsw.NotFoundError" title="apsw.NotFoundError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">NotFoundError</span></code></a>.</p>
<p>If <cite>name</cite> is None, then all systemcalls are reset to their defaults.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>True if the system call was set. False if the system
call is not known.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFS.xSleep">
<span class="sig-prename descclassname"><span class="pre">VFS.</span></span><span class="sig-name descname"><span class="pre">xSleep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">microseconds</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.VFS.xSleep" title="Link to this definition"></a></dt>
<dd><p>Pause execution of the thread for at least the specified number of
microseconds (millionths of a second). This routine is typically called from the busy handler.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>How many microseconds you actually requested the
operating system to sleep for. For example if your operating
system sleep call only takes seconds then you would have to have
rounded the microseconds number up to the nearest second and
should return that rounded up value.</p>
</dd>
</dl>
</dd></dl>
</section>
<section id="vfsfile-class">
<h2>VFSFile class<a class="headerlink" href="#vfsfile-class" title="Link to this heading"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="apsw.VFSFile">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apsw.</span></span><span class="sig-name descname"><span class="pre">VFSFile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vfs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#apsw.URIFilename" title="apsw.URIFilename"><span class="pre">URIFilename</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.12)"><span class="pre">list</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#apsw.VFSFile" title="Link to this definition"></a></dt>
<dd><p>Wraps access to a file. You only need to derive from this class
if you want the file object returned from <a class="reference internal" href="#apsw.VFS.xOpen" title="apsw.VFS.xOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VFS.xOpen()</span></code></a> to
inherit from an existing VFS implementation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>vfs</strong> – The vfs you want to inherit behaviour from. You can
use an empty string <code class="docutils literal notranslate"><span class="pre">""</span></code> to inherit from the default vfs.</p></li>
<li><p><strong>name</strong> – The name of the file being opened. May be an instance of <a class="reference internal" href="#apsw.URIFilename" title="apsw.URIFilename"><code class="xref py py-class docutils literal notranslate"><span class="pre">URIFilename</span></code></a>.</p></li>
<li><p><strong>flags</strong> – A two item list <code class="docutils literal notranslate"><span class="pre">[inflags,</span> <span class="pre">outflags]</span></code> as detailed in <a class="reference internal" href="#apsw.VFS.xOpen" title="apsw.VFS.xOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VFS.xOpen()</span></code></a>.</p></li>
</ul>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.12)"><strong>ValueError</strong></a> – If the named VFS is not registered.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If the VFS that you inherit from supports <a class="reference internal" href="tips.html#wal"><span class="std std-ref">write ahead
logging</span></a> then your <a class="reference internal" href="#apsw.VFSFile" title="apsw.VFSFile"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFSFile</span></code></a> will also support the
xShm methods necessary to implement wal.</p>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#apsw.VFS.xOpen" title="apsw.VFS.xOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VFS.xOpen()</span></code></a></p>
</div>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.excepthook">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">excepthook</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">etype</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.12)"><span class="pre">type</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#BaseException" title="(in Python v3.12)"><span class="pre">BaseException</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evalue</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#BaseException" title="(in Python v3.12)"><span class="pre">BaseException</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">etraceback</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/types.html#types.TracebackType" title="(in Python v3.12)"><span class="pre">types.TracebackType</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.excepthook" title="Link to this definition"></a></dt>
<dd><p>Called when there has been an exception in a <a class="reference internal" href="#apsw.VFSFile" title="apsw.VFSFile"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFSFile</span></code></a>
routine, and it can’t be reported to the caller as usual.</p>
<p>The default implementation passes the exception information
to sqlite3_log, and the first non-error of
<a class="reference external" href="https://docs.python.org/3/library/sys.html#sys.unraisablehook" title="(in Python v3.12)"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys.unraisablehook()</span></code></a> and <a class="reference external" href="https://docs.python.org/3/library/sys.html#sys.excepthook" title="(in Python v3.12)"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys.excepthook()</span></code></a>, falling back to
<cite>PyErr_Display</cite>.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xCheckReservedLock">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xCheckReservedLock</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xCheckReservedLock" title="Link to this definition"></a></dt>
<dd><p>Returns True if any database connection (in this or another process)
has a lock other than <a class="reference external" href="https://sqlite.org/c3ref/c_lock_exclusive.html">SQLITE_LOCK_NONE or SQLITE_LOCK_SHARED</a>.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xClose">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xClose</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xClose" title="Link to this definition"></a></dt>
<dd><p>Close the database. Note that even if you return an error you should
still close the file. It is safe to call this method multiple
times.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xDeviceCharacteristics">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xDeviceCharacteristics</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xDeviceCharacteristics" title="Link to this definition"></a></dt>
<dd><p>Return <a class="reference external" href="https://sqlite.org/c3ref/c_iocap_atomic.html">I/O capabilities</a> (bitwise or of
appropriate values). If you do not implement the function or have an
error then 0 (the SQLite default) is returned.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xFileControl">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xFileControl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">op</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">ptr</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xFileControl" title="Link to this definition"></a></dt>
<dd><blockquote>
<div><p>Receives <a class="reference external" href="https://sqlite.org/c3ref/file_control.html">file control</a> request typically
issued by <a class="reference internal" href="connection.html#apsw.Connection.file_control" title="apsw.Connection.file_control"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.file_control()</span></code></a>. See
<a class="reference internal" href="connection.html#apsw.Connection.file_control" title="apsw.Connection.file_control"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.file_control()</span></code></a> for an example of how to pass a
Python object to this routine.</p>
<dl class="field-list simple">
<dt class="field-odd">param op<span class="colon">:</span></dt>
<dd class="field-odd"><p>A numeric code. Codes below 100 are reserved for SQLite
internal use.</p>
</dd>
<dt class="field-even">param ptr<span class="colon">:</span></dt>
<dd class="field-even"><p>An integer corresponding to a pointer at the C level.</p>
</dd>
<dt class="field-odd">returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A boolean indicating if the op was understood</p>
</dd>
</dl>
<p>Ensure you pass any unrecognised codes through to your super class.
For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">xFileControl</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">op</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">ptr</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
<span class="k">if</span> <span class="n">op</span> <span class="o">==</span> <span class="mi">1027</span><span class="p">:</span>
<span class="n">process_quick</span><span class="p">(</span><span class="n">ptr</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">op</span> <span class="o">==</span> <span class="mi">1028</span><span class="p">:</span>
<span class="n">obj</span><span class="o">=</span><span class="n">ctypes</span><span class="o">.</span><span class="n">py_object</span><span class="o">.</span><span class="n">from_address</span><span class="p">(</span><span class="n">ptr</span><span class="p">)</span><span class="o">.</span><span class="n">value</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># this ensures superclass implementation is called</span>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">xFileControl</span><span class="p">(</span><span class="n">op</span><span class="p">,</span> <span class="n">ptr</span><span class="p">)</span>
<span class="c1"># we understood the op</span>
<span class="k">return</span> <span class="kc">True</span>
</pre></div>
</div>
</div></blockquote>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><a class="reference external" href="https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlvfsname">SQLITE_FCNTL_VFSNAME</a>
is automatically handled for you dealing with the necessary memory allocation
and listing all the VFS if you are inheriting. It includes the fully qualified
class name for this object.</p>
</div>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xFileSize">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xFileSize</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xFileSize" title="Link to this definition"></a></dt>
<dd><p>Return the size of the file in bytes.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xLock">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xLock</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">level</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xLock" title="Link to this definition"></a></dt>
<dd><p>Increase the lock to the level specified which is one of the
<a class="reference external" href="https://sqlite.org/c3ref/c_lock_exclusive.html">SQLITE_LOCK</a>
family of constants. If you can’t increase the lock level because
someone else has locked it, then raise <a class="reference internal" href="exceptions.html#apsw.BusyError" title="apsw.BusyError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">BusyError</span></code></a>.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xRead">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xRead</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">amount</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.12)"><span class="pre">bytes</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xRead" title="Link to this definition"></a></dt>
<dd><p>Read the specified <em>amount</em> of data starting at <em>offset</em>. You
should make every effort to read all the data requested, or return
an error. If you have the file open for non-blocking I/O or if
signals happen then it is possible for the underlying operating
system to do a partial read. You will need to request the
remaining data. Except for empty files SQLite considers short
reads to be a fatal error.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>amount</strong> – Number of bytes to read</p></li>
<li><p><strong>offset</strong> – Where to start reading.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xSectorSize">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xSectorSize</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xSectorSize" title="Link to this definition"></a></dt>
<dd><p>Return the native underlying sector size. SQLite uses the value
returned in determining the default database page size. If you do
not implement the function or have an error then 4096 (the SQLite
default) is returned.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xSync">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xSync</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">flags</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xSync" title="Link to this definition"></a></dt>
<dd><p>Ensure data is on the disk platters (ie could survive a power
failure immediately after the call returns) with the <a class="reference external" href="https://sqlite.org/c3ref/c_sync_dataonly.html">sync flags</a> detailing what
needs to be synced.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xTruncate">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xTruncate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">newsize</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xTruncate" title="Link to this definition"></a></dt>
<dd><p>Set the file length to <em>newsize</em> (which may be more or less than the
current length).</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xUnlock">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xUnlock</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">level</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xUnlock" title="Link to this definition"></a></dt>
<dd><p>Decrease the lock to the level specified which is one of the
<a class="reference external" href="https://sqlite.org/c3ref/c_lock_exclusive.html">SQLITE_LOCK</a>
family of constants.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.VFSFile.xWrite">
<span class="sig-prename descclassname"><span class="pre">VFSFile.</span></span><span class="sig-name descname"><span class="pre">xWrite</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.12)"><span class="pre">bytes</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.VFSFile.xWrite" title="Link to this definition"></a></dt>
<dd><p>Write the <em>data</em> starting at absolute <em>offset</em>. You must write all the data
requested, or return an error. If you have the file open for
non-blocking I/O or if signals happen then it is possible for the
underlying operating system to do a partial write. You will need to
write the remaining data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>offset</strong> – Where to start writing.</p>
</dd>
</dl>
</dd></dl>
</section>
<section id="urifilename-class">
<h2>URIFilename class<a class="headerlink" href="#urifilename-class" title="Link to this heading"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="apsw.URIFilename">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apsw.</span></span><span class="sig-name descname"><span class="pre">URIFilename</span></span><a class="headerlink" href="#apsw.URIFilename" title="Link to this definition"></a></dt>
<dd><p>SQLite packs <a class="reference external" href="https://sqlite.org/uri.html">uri parameters</a> and the filename together This class
encapsulates that packing. The <a class="reference internal" href="example.html#example-vfs"><span class="std std-ref">example</span></a> shows
usage of this class.</p>
<p>Your <a class="reference internal" href="#apsw.VFS.xOpen" title="apsw.VFS.xOpen"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VFS.xOpen()</span></code></a> method will generally be passed one of
these instead of a string as the filename if the URI flag was used
or the main database flag is set.</p>
<p>You can safely pass it on to the <a class="reference internal" href="#apsw.VFSFile" title="apsw.VFSFile"><code class="xref py py-class docutils literal notranslate"><span class="pre">VFSFile</span></code></a> constructor
which knows how to get the name back out. The URIFilename is
only valid for the duration of the xOpen call. If you save
and use the object later you will get an exception.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apsw.URIFilename.filename">
<span class="sig-prename descclassname"><span class="pre">URIFilename.</span></span><span class="sig-name descname"><span class="pre">filename</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></span><a class="headerlink" href="#apsw.URIFilename.filename" title="Link to this definition"></a></dt>
<dd><p>Returns the filename.</p>
</dd></dl>
<dl class="py attribute" id="index-2">
<dt class="sig sig-object py" id="apsw.URIFilename.parameters">
<span class="sig-prename descclassname"><span class="pre">URIFilename.</span></span><span class="sig-name descname"><span class="pre">parameters</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.12)"><span class="pre">tuple</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#apsw.URIFilename.parameters" title="Link to this definition"></a></dt>
<dd><p>A tuple of the parameter names present.</p>
<p>Calls: <a class="reference external" href="https://sqlite.org/c3ref/uri_boolean.html">sqlite3_uri_key</a></p>
</dd></dl>
<dl class="py method" id="index-3">
<dt class="sig sig-object py" id="apsw.URIFilename.uri_boolean">
<span class="sig-prename descclassname"><span class="pre">URIFilename.</span></span><span class="sig-name descname"><span class="pre">uri_boolean</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></span><a class="headerlink" href="#apsw.URIFilename.uri_boolean" title="Link to this definition"></a></dt>
<dd><p>Returns the boolean value for parameter <cite>name</cite> or <cite>default</cite> if not
present.</p>
<p>Calls: <a class="reference external" href="https://sqlite.org/c3ref/uri_boolean.html">sqlite3_uri_boolean</a></p>
</dd></dl>
<dl class="py method" id="index-4">
<dt class="sig sig-object py" id="apsw.URIFilename.uri_int">
<span class="sig-prename descclassname"><span class="pre">URIFilename.</span></span><span class="sig-name descname"><span class="pre">uri_int</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></span><a class="headerlink" href="#apsw.URIFilename.uri_int" title="Link to this definition"></a></dt>
<dd><p>Returns the integer value for parameter <cite>name</cite> or <cite>default</cite> if not
present.</p>
<p>Calls: <a class="reference external" href="https://sqlite.org/c3ref/uri_boolean.html">sqlite3_uri_int64</a></p>
</dd></dl>
<dl class="py method" id="index-5">
<dt class="sig sig-object py" id="apsw.URIFilename.uri_parameter">
<span class="sig-prename descclassname"><span class="pre">URIFilename.</span></span><span class="sig-name descname"><span class="pre">uri_parameter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#apsw.URIFilename.uri_parameter" title="Link to this definition"></a></dt>
<dd><p>Returns the value of parameter <cite>name</cite> or None.</p>
<p>Calls: <a class="reference external" href="https://sqlite.org/c3ref/uri_boolean.html">sqlite3_uri_parameter</a></p>
</dd></dl>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="vtable.html" class="btn btn-neutral float-left" title="Virtual Tables" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="shell.html" class="btn btn-neutral float-right" title="Shell" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© <a href="copyright.html">Copyright</a> 2004-2024, Roger Binns <rogerb@rogerbinns.com>.
<span class="lastupdated">Last updated on Jun 16, 2024.
</span></p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
|