
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
lambdaorm-cli
Advanced tools
Ξ»ORM CLI is a command line application to use Ξ»ORM
Install the package globally to use the CLI commands to help you create and maintain projects
npm install lambdaorm-cli -g
Command | Description |
---|---|
version | Prints lambdaorm version this project uses. |
init | Generates lambdaorm project structure. |
sync | Synchronize database. |
execute | Execute an expression lambda. |
metadata | Return metadata of query expression. |
parameters | Return parameters of query expression. |
model | Return model of query expression. |
plan | Return plan execution of query expression. |
import | Import data from file to database. |
export | Export data from a database. |
build | add configuration, model and repositories according to the language. |
drop | Removes all database objects but not the database. |
Prints lambdaorm version this project uses.
lambdaorm version
Result:
Global lambdaorm cli version: 0.9.21
Local lambdaorm version: 0.8.96
will create the project folder with the basic structure.
lambdaorm init -w lab
It will generate:
βββ data
βββ lambdaORM.yaml
Synchronize Stage configured in lambdaORM schema with database/s.
lambdaorm sync
In the case the default stage is associated with several data sources, it generates a file for each data source and a file with the current model.
data
βββ default-ddl-20231201T191054280Z-sync-Catalog.sql
βββ default-ddl-20231201T191054280Z-sync-Crm.sql
βββ default-ddl-20231201T191054281Z-sync-Ordering.json
βββ default-model.json
Execute an expression lambda.
lambdaorm execute -e .env -q "Orders.filter(p => p.customerId == customerId).include(p => [p.customer.map(p => p.name), p.details.include(p => p.product.include(p => p.category.map(p => p.name)).map(p => p.name)).map(p => [p.quantity, p.unitPrice])]).page(1,1)" -d "{\"customerId\": \"HANAR\"}"
Result:
[
{
"id": 3,
"customerId": "HANAR",
"employeeId": 4,
"orderDate": "1996-07-08T00:00:00.000+02:00",
"requiredDate": "1996-08-05",
"shippedDate": "1996-07-12",
"shipViaId": 2,
"freight": 65.83,
"name": "Hanari Carnes",
"address": "Rua do Pao, 67",
"city": "Rio de Janeiro",
"region": "RJ",
"postalCode": "05454-876",
"country": "Brazil",
"details": [
{
"quantity": 10,
"unitPrice": 7.7,
"product": {
"name": "Jack's New England Clam Chowder",
"category": {
"name": "Seafood"
}
}
},
{
"quantity": 35,
"unitPrice": 42.4,
"product": {
"name": "Manjimup Dried Apples",
"category": {
"name": "Produce"
}
}
},
{
"quantity": 15,
"unitPrice": 16.8,
"product": {
"name": "Louisiana Fiery Hot Pepper Sauce",
"category": {
"name": "Condiments"
}
}
}
],
"customer": {
"name": "Hanari Carnes"
}
}
]
In this example:
Return plan execution of query expression.
lambdaorm plan -e .env -s default -q "Orders.filter(p => p.customerId == customerId).include(p => p.customer.map(p => p.name)).order(p=> p.id).page(1,1)" -o beautiful
Result:
{
"entity": "Orders",
"dialect": "MongoDB",
"source": "Ordering",
"sentence": "[{ \"$match\" : { \"CustomerID\":{{customerId}} } }, { \"$project\" :{ \"_id\": 0 , \"id\":\"$_id\", \"customerId\":\"$CustomerID\", \"orderDate\":\"$OrderDate\", \"__customerId\":\"$CustomerID\" }} , { \"$sort\" :{ \"_id\":1 } } , { \"$skip\" : 0 }, { \"$limit\" : 1 } , { \"$project\": { \"_id\": 0 } }]",
"children": [
{
"entity": "Customers",
"dialect": "PostgreSQL",
"source": "Crm",
"sentence": "SELECT c.CompanyName AS \"name\", c.CustomerID AS \"LambdaOrmParentId\" FROM Customers c WHERE c.CustomerID IN ($1) "
}
]
}
In this example:
Import data from file to datasources asociados a un stage.
```sh
lambdaorm import -e .env -s default -d ./data.json
In this example:
Export data from a datasource associated to a stage.
lambdaorm export -s stage1 -e .env
In this example:
Running the build command will create or update the following:
Add configuration, model and repositories according to the language.
lambdaorm build -l node
Result:
βββ data
βββ lambdaORM.yaml
βββ package.json
βββ src
β βββ countries
β βββ domain
β βββ model.ts
β βββ repositoryCountry.ts
β βββ repositoryState.ts
βββ tsconfig.json
lambdaorm build -l client-node --all
Result:
βββ data
βββ lambdaORM.yaml
βββ package.json
βββ src
β βββ index.ts
β βββ northwind
β βββ domain
β βββ model.ts
β βββ repositoryCategory.ts
β βββ repositoryCustomer.ts
β βββ repositoryOrdersDetail.ts
β βββ repositoryOrder.ts
β βββ repositoryProduct.ts
βββ tsconfig.json
Removes all database objects but not the database.
lambdaorm drop -e .env -s default
lambdaorm drop -e .env -s insights
Result:
data
βββ default-ddl-20231129T110712162Z-sync-Catalog.sql
βββ default-ddl-20231129T110712163Z-sync-Crm.sql
βββ default-ddl-20231129T110712163Z-sync-Ordering.json
βββ default-ddl-20231129T111730593Z-clean-Catalog.sql
βββ default-ddl-20231129T111730594Z-clean-Crm.sql
βββ default-ddl-20231129T111730594Z-clean-Ordering.json
βββ insights-ddl-20231129T110303423Z-sync-Insights.sql
βββ insights-ddl-20231129T111738316Z-clean-Insights.sql
In this example:
Full documentation is available in the Wiki.
You can access various labs at github.com/FlavioLionelRita/lambdaorm-labs
FAQs
The lambdaorm command line interface
The npm package lambdaorm-cli receives a total of 196 weekly downloads. As such, lambdaorm-cli popularity was classified as not popular.
We found that lambdaorm-cli 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.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnamβs Telegram ban.