Skip to content

Database

MongoDB, MySQL, PostgreSQL, and Redis database operations.

9 modules

ModuleDescription
Veritabanı EkleVeritabanı tablolarına veri ekle
Veritabanı SorgusuPostgreSQL, MySQL veya SQLite veritabanlarında SQL sorguları çalıştır
Veritabanı GüncelleVeritabanı tablolarındaki verileri güncelle
MongoDB BulMongoDB koleksiyonundan belgeleri sorgula
MongoDB EkleMongoDB koleksiyonuna bir veya daha fazla belge ekle
MySQL SorgusuMySQL veritabanında SQL sorgusu çalıştır ve sonuçları döndür
PostgreSQL SorgusuPostgreSQL veritabanında SQL sorgusu çalıştır ve sonuçları döndür
Redis AlRedis önbelleğinden değer al
Redis AyarlaRedis önbelleğinde değer ayarla

Modules

Veritabanı Ekle

database.insert

Veritabanı tablolarına veri ekle

Parameters:

NameTypeRequiredDefaultDescription
tablestringYes-Name of the table
dataobjectYes-Data to insert or update
database_typeselect (postgresql, mysql, sqlite)NopostgresqlDatabase type to connect to
connection_stringstringNo-Database connection string
hoststringNo-Database host
portnumberNo-Database port
databasestringNo-Database name
userstringNo-Database username
passwordstringNo-Database password
returningarrayNo-Columns to return after insert (PostgreSQL)

Output:

FieldTypeDescription
inserted_countnumberEklenen satır sayısı
returning_dataarrayEklenen satır sayısı

Example: Insert single row

yaml
table: users
data: {"name": "John", "email": "john@example.com"}
database_type: postgresql

Veritabanı Sorgusu

database.query

PostgreSQL, MySQL veya SQLite veritabanlarında SQL sorguları çalıştır

Parameters:

NameTypeRequiredDefaultDescription
querystringYes-SQL query to execute
paramsarrayNo[]Parameters for parameterized queries (prevents SQL injection)
database_typeselect (postgresql, mysql, sqlite)NopostgresqlDatabase type to connect to
connection_stringstringNo-Database connection string
hoststringNo-Database host
portnumberNo-Database port
databasestringNo-Database name
userstringNo-Database username
passwordstringNo-Database password
fetchselect (all, one, none)NoallHow many rows to return from the query

Output:

FieldTypeDescription
rowsarraySorgu sonuç satırları
row_countnumberSorgu sonuç satırları
columnsarraySorgu sonuç satırları

Example: Select with parameters

yaml
query: SELECT * FROM users WHERE status = $1
params: ["active"]
database_type: postgresql

Veritabanı Güncelle

database.update

Veritabanı tablolarındaki verileri güncelle

Parameters:

NameTypeRequiredDefaultDescription
tablestringYes-Name of the table
dataobjectYes-Data to insert or update
whereobjectYes-WHERE conditions (column: value for equality)
database_typeselect (postgresql, mysql, sqlite)NopostgresqlDatabase type to connect to
connection_stringstringNo-Database connection string
hoststringNo-Database host
portnumberNo-Database port
databasestringNo-Database name
userstringNo-Database username
passwordstringNo-Database password

Output:

FieldTypeDescription
updated_countnumberGüncellenen satır sayısı

Example: Update user status

yaml
table: users
data: {"status": "active"}
where: {"id": 123}
database_type: postgresql

MongoDB Bul

db.mongodb.find

MongoDB koleksiyonundan belgeleri sorgula

Parameters:

NameTypeRequiredDefaultDescription
connection_stringstringNo-MongoDB connection string (defaults to env.MONGODB_URL)
databasestringYes-Database name
collectionstringYes-Collection name
filterobjectNo{}MongoDB query filter (empty object {} returns all)
projectionobjectNo-Fields to include/exclude in results
limitnumberNo100Maximum number of documents to return
sortobjectNo-Sort order (1 for ascending, -1 for descending)

Output:

FieldTypeDescription
documentsarrayEşleşen belge dizisi
countnumberEşleşen belge dizisi

Example: Find all active users

yaml
database: myapp
collection: users
filter: {"status": "active"}
limit: 50

Example: Find with projection and sort

yaml
database: myapp
collection: orders
filter: {"total": {"$gt": 100}}
projection: {"_id": 0, "order_id": 1, "total": 1, "created_at": 1}
sort: {"created_at": -1}
limit: 20

MongoDB Ekle

db.mongodb.insert

MongoDB koleksiyonuna bir veya daha fazla belge ekle

Parameters:

NameTypeRequiredDefaultDescription
connection_stringstringNo-MongoDB connection string (defaults to env.MONGODB_URL)
databasestringYes-Database name
collectionstringYes-Collection name
documentobjectNo-Document to insert (for single insert)
documentsarrayNo-Array of documents to insert (for bulk insert)

Output:

FieldTypeDescription
inserted_countnumberEklenen belge sayısı
inserted_idsarrayEklenen belge sayısı

Example: Insert single document

yaml
database: myapp
collection: users
document: {"name": "John Doe", "email": "john@example.com", "created_at": "${timestamp}"}

Example: Insert multiple documents

yaml
database: myapp
collection: products
documents: [{"name": "Product A", "price": 19.99}, {"name": "Product B", "price": 29.99}]

MySQL Sorgusu

db.mysql.query

MySQL veritabanında SQL sorgusu çalıştır ve sonuçları döndür

Parameters:

NameTypeRequiredDefaultDescription
hoststringNo-Database host
portnumberNo3306Database port
userstringNo-Database username
passwordstringNo-Database password
databasestringNo-Database name
querystringYes-SQL query to execute
paramsarrayNo[]Parameters for parameterized queries (prevents SQL injection)

Output:

FieldTypeDescription
rowsarrayNesne olarak sonuç satırları dizisi
row_countnumberNesne olarak sonuç satırları dizisi
columnsarrayNesne olarak sonuç satırları dizisi

Example: Select products

yaml
query: SELECT id, name, price FROM products WHERE stock > 0 ORDER BY price DESC LIMIT 20

Example: Parameterized query

yaml
query: SELECT * FROM orders WHERE customer_id = %s AND created_at > %s
params: ["${customer_id}", "2024-01-01"]

PostgreSQL Sorgusu

db.postgresql.query

PostgreSQL veritabanında SQL sorgusu çalıştır ve sonuçları döndür

Parameters:

NameTypeRequiredDefaultDescription
connection_stringstringNo-Database connection string
querystringYes-SQL query to execute
paramsarrayNo[]Parameters for parameterized queries (prevents SQL injection)

Output:

FieldTypeDescription
rowsarrayNesne olarak sonuç satırları dizisi
row_countnumberNesne olarak sonuç satırları dizisi
columnsarrayNesne olarak sonuç satırları dizisi

Example: Select users

yaml
query: SELECT id, email, created_at FROM users WHERE active = true LIMIT 10

Example: Parameterized query

yaml
query: SELECT * FROM orders WHERE user_id = $1 AND status = $2
params: ["${user_id}", "completed"]

Redis Al

db.redis.get

Redis önbelleğinden değer al

Parameters:

NameTypeRequiredDefaultDescription
keystringYes-Redis key
hoststringNo-Redis host (from env.REDIS_HOST or explicit)
portnumberNo6379Redis port
dbnumberNo0Redis database number

Output:

FieldTypeDescription
valueanyDöndürülen değer
existsbooleanDöndürülen değer
keystringDöndürülen değer

Example: Get cached value

yaml
key: user:123:profile
host: ${env.REDIS_HOST}

Example: Get from remote Redis

yaml
key: session:abc
host: redis.example.com
port: 6379
db: 1

Redis Ayarla

db.redis.set

Redis önbelleğinde değer ayarla

Parameters:

NameTypeRequiredDefaultDescription
keystringYes-Redis key
valueanyYes-Value to store
ttlnumberNo-Time to live in seconds (optional)
hoststringNo-Redis host (from env.REDIS_HOST or explicit)
portnumberNo6379Redis port
dbnumberNo0Redis database number

Output:

FieldTypeDescription
successbooleanWhether the operation completed successfully
keystringKey identifier

Example: Cache user profile

yaml
key: user:123:profile
value: {"name": "John", "email": "john@example.com"}
ttl: 3600

Example: Set session data

yaml
key: session:abc
value: active
ttl: 1800
host: redis.example.com

Released under the Apache 2.0 License.