
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@gftdcojp/gftd-ksqldb-orm
Advanced tools
ksqlDB ORM - TypeScript ORM for ksqlDB with schema registry support
Enterprise-grade ksqlDB ORM with TypeScript support, schema registry integration, and advanced features.
pnpm add @gftdcojp/gftd-ksqldb-orm
This package supports both Browser and Server environments with optimized entry points:
// Optimized for browser - excludes Node.js specific features
import { KsqlDbClientBrowser, executeQuery } from '@gftdcojp/gftd-ksqldb-orm/browser';
// Full feature set including file operations and CLI tools
import { KsqlDbClientBrowser, TypeGenerator, AuditLogManager } from '@gftdcojp/gftd-ksqldb-orm/server';
// Automatically detects environment and provides safe features
import { KsqlDbClientBrowser, executeQuery } from '@gftdcojp/gftd-ksqldb-orm';
The package includes comprehensive tests for both browser and server environments:
# Run all tests
pnpm test
# Run with coverage
pnpm run test:coverage
# Run in watch mode
pnpm run test:watch
# Run Next.js specific tests
pnpm run test:nextjs-client
pnpm run test:nextjs-server
# Run integration tests
pnpm run test:integration
The current test suite achieves 44.47% code coverage, with comprehensive testing of:
import { createDatabaseClient } from '@gftdcojp/gftd-ksqldb-orm/client';
// データベースクライアントを作成
const dbClient = createDatabaseClient({
ksql: {
url: 'http://localhost:8088',
apiKey: 'your-api-key',
apiSecret: 'your-api-secret'
}
});
await dbClient.initialize();
// Supabaseライクなクエリ(簡単・直感的)
const { data, error } = await dbClient
.from('users')
.eq('status', 'active')
.limit(10)
.execute();
if (error) {
console.error('Query failed:', error);
} else {
console.log('Users:', data);
}
// 単一レコード取得
const { data: user } = await dbClient
.from('users')
.eq('id', 1)
.single();
// データ挿入
const { data: newUser } = await dbClient
.from('users')
.insert({
name: 'John Doe',
email: 'john@example.com',
status: 'active'
});
import { createDatabaseClient, DatabaseClient } from '@gftdcojp/gftd-ksqldb-orm/client';
// クライアント作成
const dbClient = createDatabaseClient({
ksql: { url: 'http://localhost:8088' }
});
// データ取得
const { data } = await dbClient.from('users').execute();
// 条件付き検索(全ての演算子)
const { data } = await dbClient
.from('users')
.eq('status', 'active') // 等価
.neq('type', 'test') // 不等価
.gt('age', 18) // より大きい
.between('score', 80, 100) // 範囲
.like('name', '%john%') // パターンマッチ
.in('department', ['eng', 'dev']) // 複数値
.isNotNull('email') // NOT NULL
.order('created_at', false)
.limit(25)
.execute();
// データ操作
// 単一挿入
await dbClient.from('users').insert({
name: 'John',
email: 'john@example.com'
});
// バッチ挿入
await dbClient.from('users').insert([
{ name: 'Alice', email: 'alice@example.com' },
{ name: 'Bob', email: 'bob@example.com' },
{ name: 'Charlie', email: 'charlie@example.com' }
]);
// 複雑な条件での更新・削除
await dbClient.from('users').eq('id', 1).update({ name: 'Jane' });
await dbClient.from('users').lt('last_login', '2024-01-01').delete();
import {
generateTypesForTables,
listAllTables,
getTableSchema
} from '@gftdcojp/gftd-ksqldb-orm/type-generator';
import {
initializeSchemaRegistryClient,
registerSchema,
getLatestSchema
} from '@gftdcojp/gftd-ksqldb-orm/schema-registry';
import {
RLSManager,
PolicyType
} from '@gftdcojp/gftd-ksqldb-orm/row-level-security';
📚 完全ドキュメント集 - 詳細なガイドと学習パス 🔗 高レベルクエリビルダー - 完全なAPIリファレンス
// 全データ取得
const { data } = await dbClient.from('users').execute();
// 様々な条件での検索
const { data } = await dbClient
.from('users')
.eq('status', 'active') // 等価条件
.neq('type', 'test') // 不等価条件
.gt('age', 18) // より大きい
.between('score', 80, 100) // 範囲条件
.like('name', '%john%') // パターンマッチ
.in('department', ['eng', 'dev']) // 複数値検索
.isNotNull('email') // NOT NULL判定
.order('created_at', false)
.limit(10)
.execute();
// 単一レコード取得
const { data: user } = await dbClient
.from('users')
.eq('id', 123)
.single();
// NULL値の検索
const { data: usersWithoutEmail } = await dbClient
.from('users')
.isNull('email')
.execute();
// NOT IN条件
const { data: nonTestUsers } = await dbClient
.from('users')
.notIn('status', ['test', 'deleted'])
.execute();
// 単一データ挿入
const { data } = await dbClient
.from('users')
.insert({
name: 'John Doe',
email: 'john@example.com',
status: 'active'
});
// バッチデータ挿入(複数レコード)
const { data } = await dbClient
.from('users')
.insert([
{ name: 'Alice', email: 'alice@example.com', status: 'active' },
{ name: 'Bob', email: 'bob@example.com', status: 'pending' },
{ name: 'Charlie', email: 'charlie@example.com', status: 'active' }
]);
// 複雑な条件でのデータ更新
const { data } = await dbClient
.from('users')
.between('created_at', '2024-01-01', '2024-01-31')
.eq('status', 'pending')
.update({
status: 'verified',
updated_at: new Date().toISOString()
});
// 条件付きデータ削除
const { data } = await dbClient
.from('users')
.lt('last_login', '2023-01-01')
.eq('status', 'inactive')
.delete();
import { rls } from '@gftdcojp/gftd-ksqldb-orm/row-level-security';
// セキュリティポリシー作成
rls.createPolicy({
tableName: 'users_table',
condition: 'user_id = auth.user_id()',
roles: ['authenticated']
});
import { generateTypesForTables } from '@gftdcojp/gftd-ksqldb-orm/type-generator';
// 全テーブルの型定義を自動生成
const typeDefinitions = await generateTypesForTables();
import { registerSchema } from '@gftdcojp/gftd-ksqldb-orm/schema-registry';
// Avroスキーマ登録
await registerSchema('users-value', userSchema, 'AVRO');
# Generate types for all tables
npx gftd-ksqldb-orm generate-all --output ./types
# Generate types for specific table
npx gftd-ksqldb-orm generate-types --table users_table --output ./types
# List all tables and streams
npx gftd-ksqldb-orm list
# Dry run (show what would be generated)
npx gftd-ksqldb-orm generate-all --dry --verbose
# Custom output format
npx gftd-ksqldb-orm generate-types --table orders --format ts --output ./src/types
GFTD_DB_URL=http://localhost:8088
GFTD_DB_API_KEY=your-api-key
GFTD_DB_API_SECRET=your-api-secret
GFTD_SCHEMA_REGISTRY_URL=http://localhost:8081
import { KsqlDbConfig } from '@gftdcojp/gftd-ksqldb-orm';
const config: KsqlDbConfig = {
url: 'http://localhost:8088',
apiKey: 'your-api-key',
apiSecret: 'your-api-secret',
headers: {
'Custom-Header': 'value'
}
};
MIT License - see the LICENSE file for details.
Please read our contributing guidelines before submitting pull requests.
FAQs
ksqlDB ORM - TypeScript ORM for ksqlDB with schema registry support
The npm package @gftdcojp/gftd-ksqldb-orm receives a total of 0 weekly downloads. As such, @gftdcojp/gftd-ksqldb-orm popularity was classified as not popular.
We found that @gftdcojp/gftd-ksqldb-orm 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.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.