
Research
/Security News
Popular Go Decimal Library Targeted by Long-Running Typosquat with DNS Backdoor
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.
@drizzle-adapter/sqlite-core
Advanced tools
Shared SQLite functionality for the Drizzle Adapter ecosystem.
The @drizzle-adapter/sqlite-core package provides shared SQLite functionality used by SQLite-compatible adapters in the Drizzle Adapter ecosystem. This package is an internal dependency used by:
This package standardizes SQLite-specific functionality across different SQLite-compatible adapters:
# This package is typically not installed directly but as a dependency of SQLite adapters
pnpm install @drizzle-adapter/sqlite-core
If you're developing a new SQLite-compatible adapter for the Drizzle Adapter ecosystem, you should use this package to ensure consistency with other SQLite adapters:
import { SQLiteDrizzleDataTypes } from '@drizzle-adapter/sqlite-core';
export class YourSQLiteAdapter implements DrizzleAdapterInterface {
public getDataTypes(): SQLiteDrizzleDataTypes {
return new SQLiteDrizzleDataTypes();
}
// ... rest of your adapter implementation
}
The package provides standardized SQLite data type definitions:
const dataTypes = new SQLiteDrizzleDataTypes();
const table = dataTypes.dbTable('example', {
// Numeric types
id: dataTypes.dbInteger('id').primaryKey().autoincrement(),
count: dataTypes.dbInteger('count'),
amount: dataTypes.dbReal('amount'),
// String types
name: dataTypes.dbText('name'),
description: dataTypes.dbText('description'),
// Date/Time types (stored as INTEGER or TEXT)
createdAt: dataTypes.dbInteger('created_at')
.default(sql`(strftime('%s', 'now'))`),
updatedAt: dataTypes.dbText('updated_at')
.default(sql`CURRENT_TIMESTAMP`),
// SQLite-specific handling
json: dataTypes.dbText('json'), // JSON stored as TEXT
isActive: dataTypes.dbInteger('is_active'), // Boolean as INTEGER
blob: dataTypes.dbBlob('data') // Binary data
});
The package provides unified error handling for SQLite-specific errors:
import { handleSQLiteError } from '@drizzle-adapter/sqlite-core';
try {
// Your database operation
} catch (error) {
throw handleSQLiteError(error);
}
The package includes utilities for building SQLite-specific queries:
import {
buildInsertQuery,
buildUpdateQuery,
buildDeleteQuery,
buildSelectQuery,
buildFTSQuery
} from '@drizzle-adapter/sqlite-core';
// Build INSERT query
const insertQuery = buildInsertQuery(table, data);
// Build UPDATE query with JSON operations
const updateQuery = buildUpdateQuery(table, {
json: sql`json_set(json, '$.key', 'value')`
});
// Build DELETE query with conditions
const deleteQuery = buildDeleteQuery(table, conditions);
// Build SELECT query with joins
const selectQuery = buildSelectQuery({
table,
joins: [...],
conditions: [...],
orderBy: [...]
});
// Build full-text search query
const searchQuery = buildFTSQuery({
table: 'posts_fts',
searchTerm: 'search term',
columns: ['title', 'content']
});
The package handles SQLite-specific type mapping:
import { mapSQLiteType } from '@drizzle-adapter/sqlite-core';
// Map JavaScript types to SQLite types
const sqliteType = mapSQLiteType(value);
// Map SQLite types to JavaScript types
const jsValue = mapToJavaScript(sqliteValue, sqliteType);
// Handle JSON serialization
const jsonText = serializeJSON(value);
const jsonValue = deserializeJSON(text);
// Handle date/time
const timestamp = dateToUnixTimestamp(date);
const date = unixTimestampToDate(timestamp);
import {
createFTSTable,
createFTSIndex,
handleJSONOperations,
handleDateTimeOperations
} from '@drizzle-adapter/sqlite-core';
// Create FTS table
const ftsSQL = createFTSTable('posts_fts', ['title', 'content']);
// Create FTS index
const indexSQL = createFTSIndex('posts_fts_idx', 'posts', ['title', 'content']);
// Handle JSON operations
const jsonCondition = handleJSONOperations(column, path, value);
// Handle date/time operations
const dateCondition = handleDateTimeOperations(column, operator, value);
import {
getCurrentTimestamp,
formatDateTime,
parseDateTime,
addInterval
} from '@drizzle-adapter/sqlite-core';
// Get current timestamp
const now = getCurrentTimestamp();
// Format date/time
const formatted = formatDateTime(date, format);
// Parse date/time
const date = parseDateTime(text, format);
// Add interval
const future = addInterval(date, { days: 7, hours: 12 });
This package is maintained as part of the Drizzle Adapter ecosystem. If you'd like to contribute:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)FAQs
Shared SQLite functionality for the Drizzle Adapter ecosystem.
The npm package @drizzle-adapter/sqlite-core receives a total of 211 weekly downloads. As such, @drizzle-adapter/sqlite-core popularity was classified as not popular.
We found that @drizzle-adapter/sqlite-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.