npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dependahub/aws-rds-data

v1.0.0

Published

RDS Data API 操作モジュール

Readme

aws-rds-data

RDS Data API クライアントのラッパーです。

install

npm install @trusquetta/aws-rds-data

初期設定

import process from 'node:process';
import {rdsData} from '@trusquetta/aws-rds-data';

const {
	DB_RESOURCE_ARN,
	DB_SECRET_ARN,
	DB_DATABASE,
} = process.env;

rdsData.configure({
	profile: 'tq-dev', // (テストなど)ローカル実行時のみ指定
	resourceArn: DB_RESOURCE_ARN,
	secretArn: DB_SECRET_ARN,
	database: DB_DATABASE,
	readOnly: true, // (Optional) 誤ってデータ変更したくない場合に設定
});

SELECT

SELECT は「SQL直書き」または「テンプレート構文で生成」してデータを取り出します。
パラメーターの使用もできますが、長くなるのでテンプレート構文で十分かと思います。

const sql = 'SELECT * FROM tsukuyomi WHERE company_id is null;'
const items = await rdsData.post(sql);

INSERT

INSERT時は必ずパラメーターを使用して下さい。
パラメーターを使用すると自動でエスケープ処理されます。(AWS SDK の仕様)

// SQL文へのパラメータ名は :${name} で指定します。
const sql = `
INSERT INTO check_results
	(id, user, type, document, result, created_at, updated_at) 
VALUES
	(:id, :user, :documentType, :document, :result, :createdAt, :updatedAt)`;
// パラメーターはこちらの形式で指定します。
const parameters = [
		{
			name: 'id',
			value: {
				isNull: true,
			},
		},
		{
			name: 'user',
			value: {
				stringValue: auth.username,
			},
		},
		{
			name: 'documentType',
			value: {
				stringValue: 'document',
			},
		},
		{
			name: 'document',
			value: {
				stringValue: document,
			},
		},
		{
			name: 'result',
			value: {
				stringValue: result,
			},
		},
		{
			name: 'createdAt',
			value: {
				stringValue: now,
			},
		},
		{
			name: 'updatedAt',
			value: {
				stringValue: now,
			},
		},
	];

	return rdsData.post(sql, parameters);

異なるDBを扱う場合は create でインスタンスを作成します

const db1 = rdsData.create({
	profile: 'tq-dev', // ローカル実行時のみ指定
	resourceArn: 'arn:resource-1',
	secretArn: 'arn:secret-1',
	database: DB_DATABASE,
});
const db2 = rdsData.create({
	profile: 'tq-dev', // ローカル実行時のみ指定
	resourceArn: 'arn:resource-2',
	secretArn: 'arn:secret-2',
	database: DB_DATABASE,
});

// db1からデータを取り出して
const items = await db1.post('SELECT ...');

// db2へデータを移す
await db2.post('INSERT INTO ...');