Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Nov 14, 2024
1 parent 099c166 commit 440f365
Show file tree
Hide file tree
Showing 22 changed files with 3,644 additions and 3,292 deletions.
435 changes: 222 additions & 213 deletions src/FacadeVFS.js

Large diffs are not rendered by default.

169 changes: 84 additions & 85 deletions src/VFS.js
Original file line number Diff line number Diff line change
@@ -1,212 +1,211 @@
// Copyright 2024 Roy T. Hashimoto. All Rights Reserved.
import * as VFS from './sqlite-constants.js';
export * from './sqlite-constants.js';
import * as VFS from "./sqlite-constants.js"
export * from "./sqlite-constants.js"

const DEFAULT_SECTOR_SIZE = 512;
const DEFAULT_SECTOR_SIZE = 512

// Base class for a VFS.
export class Base {
name;
mxPathname = 64;
_module;
name
mxPathname = 64
_module

/**
* @param {string} name
* @param {object} module
* @param {string} name
* @param {object} module
*/
constructor(name, module) {
this.name = name;
this._module = module;
this.name = name
this._module = module
}

/**
* @returns {void|Promise<void>}
* @returns {void|Promise<void>}
*/
close() {
}
close() {}

/**
* @returns {boolean|Promise<boolean>}
*/
isReady() {
return true;
return true
}

/**
* Overload in subclasses to indicate which methods are asynchronous.
* @param {string} methodName
* @param {string} methodName
* @returns {boolean}
*/
hasAsyncMethod(methodName) {
return false;
return false
}

/**
* @param {number} pVfs
* @param {number} zName
* @param {number} pFile
* @param {number} flags
* @param {number} pOutFlags
* @param {number} pVfs
* @param {number} zName
* @param {number} pFile
* @param {number} flags
* @param {number} pOutFlags
* @returns {number|Promise<number>}
*/
xOpen(pVfs, zName, pFile, flags, pOutFlags) {
return VFS.SQLITE_CANTOPEN;
return VFS.SQLITE_CANTOPEN
}

/**
* @param {number} pVfs
* @param {number} zName
* @param {number} syncDir
* @param {number} pVfs
* @param {number} zName
* @param {number} syncDir
* @returns {number|Promise<number>}
*/
xDelete(pVfs, zName, syncDir) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pVfs
* @param {number} zName
* @param {number} flags
* @param {number} pResOut
* @param {number} pVfs
* @param {number} zName
* @param {number} flags
* @param {number} pResOut
* @returns {number|Promise<number>}
*/
xAccess(pVfs, zName, flags, pResOut) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pVfs
* @param {number} zName
* @param {number} nOut
* @param {number} zOut
* @param {number} pVfs
* @param {number} zName
* @param {number} nOut
* @param {number} zOut
* @returns {number|Promise<number>}
*/
xFullPathname(pVfs, zName, nOut, zOut) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pVfs
* @param {number} nBuf
* @param {number} zBuf
* @param {number} pVfs
* @param {number} nBuf
* @param {number} zBuf
* @returns {number|Promise<number>}
*/
xGetLastError(pVfs, nBuf, zBuf) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} pFile
* @returns {number|Promise<number>}
*/
xClose(pFile) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} pData
* @param {number} iAmt
* @param {number} iOffsetLo
* @param {number} iOffsetHi
* @param {number} pFile
* @param {number} pData
* @param {number} iAmt
* @param {number} iOffsetLo
* @param {number} iOffsetHi
* @returns {number|Promise<number>}
*/
xRead(pFile, pData, iAmt, iOffsetLo, iOffsetHi) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} pData
* @param {number} iAmt
* @param {number} iOffsetLo
* @param {number} iOffsetHi
* @param {number} pFile
* @param {number} pData
* @param {number} iAmt
* @param {number} iOffsetLo
* @param {number} iOffsetHi
* @returns {number|Promise<number>}
*/
xWrite(pFile, pData, iAmt, iOffsetLo, iOffsetHi) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} sizeLo
* @param {number} sizeHi
* @param {number} pFile
* @param {number} sizeLo
* @param {number} sizeHi
* @returns {number|Promise<number>}
*/
xTruncate(pFile, sizeLo, sizeHi) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} flags
* @param {number} pFile
* @param {number} flags
* @returns {number|Promise<number>}
*/
xSync(pFile, flags) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
*
* @param {number} pFile
* @param {number} pSize
*
* @param {number} pFile
* @param {number} pSize
* @returns {number|Promise<number>}
*/
xFileSize(pFile, pSize) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} lockType
* @param {number} pFile
* @param {number} lockType
* @returns {number|Promise<number>}
*/
xLock(pFile, lockType) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} lockType
* @param {number} pFile
* @param {number} lockType
* @returns {number|Promise<number>}
*/
xUnlock(pFile, lockType) {
return VFS.SQLITE_OK;
}
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} pResOut
* @param {number} pFile
* @param {number} pResOut
* @returns {number|Promise<number>}
*/
xCheckReservedLock(pFile, pResOut) {
return VFS.SQLITE_OK;
return VFS.SQLITE_OK
}

/**
* @param {number} pFile
* @param {number} op
* @param {number} pArg
* @param {number} pFile
* @param {number} op
* @param {number} pArg
* @returns {number|Promise<number>}
*/
xFileControl(pFile, op, pArg) {
return VFS.SQLITE_NOTFOUND;
return VFS.SQLITE_NOTFOUND
}

/**
* @param {number} pFile
* @param {number} pFile
* @returns {number|Promise<number>}
*/
xSectorSize(pFile) {
return DEFAULT_SECTOR_SIZE;
return DEFAULT_SECTOR_SIZE
}

/**
* @param {number} pFile
* @param {number} pFile
* @returns {number|Promise<number>}
*/
xDeviceCharacteristics(pFile) {
return 0;
return 0
}
}

Expand All @@ -218,5 +217,5 @@ export const FILE_TYPE_MASK = [
VFS.SQLITE_OPEN_TRANSIENT_DB,
VFS.SQLITE_OPEN_SUBJOURNAL,
VFS.SQLITE_OPEN_SUPER_JOURNAL,
VFS.SQLITE_OPEN_WAL
].reduce((mask, element) => mask | element);
VFS.SQLITE_OPEN_WAL,
].reduce((mask, element) => mask | element)
Loading

0 comments on commit 440f365

Please sign in to comment.