{"id":26327624,"url":"https://github.com/lambda-orm/lambdaorm-client-node","last_synced_at":"2025-07-16T07:46:53.168Z","repository":{"id":205879737,"uuid":"714368997","full_name":"lambda-orm/lambdaorm-client-node","owner":"lambda-orm","description":"Client Node for Lambdaorm Service","archived":false,"fork":false,"pushed_at":"2025-05-30T08:07:12.000Z","size":1727,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T08:53:11.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lambda-orm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-04T17:47:18.000Z","updated_at":"2025-05-30T08:06:45.000Z","dependencies_parsed_at":"2024-04-14T23:28:40.709Z","dependency_job_id":"8e7b27be-9fc0-49c5-92b7-5cc6fe3c3604","html_url":"https://github.com/lambda-orm/lambdaorm-client-node","commit_stats":null,"previous_names":["flaviolionelrita/lambdaorm-client-node","lambda-orm/lambdaorm-client-node"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/lambda-orm/lambdaorm-client-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambda-orm%2Flambdaorm-client-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambda-orm%2Flambdaorm-client-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambda-orm%2Flambdaorm-client-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambda-orm%2Flambdaorm-client-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambda-orm","download_url":"https://codeload.github.com/lambda-orm/lambdaorm-client-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambda-orm%2Flambdaorm-client-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265493329,"owners_count":23776234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-15T20:20:13.523Z","updated_at":"2025-07-16T07:46:52.990Z","avatar_url":"https://github.com/lambda-orm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# λORM Client Node\n\nLambdaorm client node is an http client to consume [lambdaorm service](https://github.com/lambda-orm/lambdaorm-svc)\n\n## Usage\n\n### Consume general endpoints\n\n```typescript\nimport { orm } from 'lambdaorm-client-node'\nimport { Orders } from './model'\n\nasync function execute() {\n  try {\n    orm.init('http://localhost:9291')\n    console.log(await orm.general.ping())\n    console.log(await orm.general.health())\n  } catch (error: any) {\n    console.error(error)\n  }\n}\nexecute()\n```\n\nResults:\n\n```javascript\n{message: 'pong', time: '2023-11-19T04:25:36.840Z'}\n{uptime: 6124.260961852, message: 'OK', time: '2023-11-19T04:25:36.846Z'}\n```\n\n### Use lambda expression\n\n```typescript\nimport { orm } from 'lambdaorm-client-node'\nimport { Orders } from './model'\n\nasync function execute() {\n  try {\n    orm.init('http://localhost:9291')\n    const query = (id: number) =\u003e\n      Orders.filter(p =\u003e p.id == id).include(p =\u003e [\n        p.customer.map(c =\u003e c.name),\n        p.details.include(d =\u003e\n          d.product.include(pr =\u003e\n            pr.category.map(cat =\u003e cat.name)\n          ).map(pr =\u003e pr.name)\n        ).map(d =\u003e [d.quantity, d.unitPrice]),\n      ])\n    const data = { id: 10248 }\n    const plan = await orm.plan(query, { stage: 'default' })\n    console.log(JSON.stringify(plan, null, 2))\n    const result = await orm.execute(query, data, { stage: 'default' })\n    console.log(JSON.stringify(result, null, 2))\n  } catch (error: any) {\n    console.error(error)\n  }\n}\nexecute()\n```\n\n### Use string expression\n\n```typescript\nimport { orm } from 'lambdaorm-client-node'\nasync function execute() {\n  try {\n    orm.init('http://localhost:9291')\n    const query = `Orders.filter(p =\u003e p.id == id)\n                    .include(p =\u003e [p.customer.map(c =\u003e c.name),p.details\n                      .include(d =\u003e d.product\n                        .include(pr =\u003e pr.category.map(cat =\u003e cat.name))\n                      .map(pr =\u003e pr.name))\n                    .map(d =\u003e [d.quantity, d.unitPrice])])`\n    const data = { id: 10248 }\n    const plan = await orm.plan(query, { stage: 'default' })\n    console.log(JSON.stringify(plan, null, 2))\n    const result = await orm.execute(query, data, { stage: 'default' })\n    console.log(JSON.stringify(result, null, 2))\n  } catch (error: any) {\n    console.error(error)\n  }\n}\nexecute()\n```\n\nResult of plan method:\n\n```json\n{\n  \"entity\": \"Orders\",\n  \"dialect\": \"MySQL\",\n  \"source\": \"default\",\n  \"sentence\": \"SELECT o.OrderID AS id, o.CustomerID AS customerId, o.EmployeeID AS employeeId, o.OrderDate AS orderDate, o.RequiredDate AS requiredDate, o.ShippedDate AS shippedDate, o.ShipVia AS shipViaId, o.Freight AS freight, o.ShipName AS name, o.ShipAddress AS address, o.ShipCity AS city, o.ShipRegion AS region, o.ShipPostalCode AS postalCode, o.ShipCountry AS country, o.CustomerID AS `__customerId`, o.OrderID AS `__id` FROM Orders o  WHERE o.OrderID = ? \",\n  \"children\": [\n    {\n      \"entity\": \"Customers\",\n      \"dialect\": \"MySQL\",\n      \"source\": \"default\",\n      \"sentence\": \"SELECT c.CompanyName AS name, c.CustomerID AS LambdaOrmParentId FROM Customers c  WHERE  c.CustomerID IN (?) \",\n      \"children\": []\n    },\n    {\n      \"entity\": \"Orders.details\",\n      \"dialect\": \"MySQL\",\n      \"source\": \"default\",\n      \"sentence\": \"SELECT o1.Quantity AS quantity, o1.UnitPrice AS unitPrice, o1.ProductID AS `__productId`, o1.OrderID AS LambdaOrmParentId FROM `Order Details` o1  WHERE  o1.OrderID IN (?) \",\n      \"children\": [\n        {\n          \"entity\": \"Products\",\n          \"dialect\": \"MySQL\",\n          \"source\": \"default\",\n          \"sentence\": \"SELECT p.ProductName AS name, p.CategoryID AS `__categoryId`, p.ProductID AS LambdaOrmParentId FROM Products p  WHERE  p.ProductID IN (?) \",\n          \"children\": [\n            {\n              \"entity\": \"Categories\",\n              \"dialect\": \"MySQL\",\n              \"source\": \"default\",\n              \"sentence\": \"SELECT c1.CategoryName AS name, c1.CategoryID AS LambdaOrmParentId FROM Categories c1  WHERE  c1.CategoryID IN (?) \",\n              \"children\": []\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\nResult of execution method:\n\n```json\n[\n  {\n    \"id\": 10248,\n    \"customerId\": \"VINET\",\n    \"employeeId\": 5,\n    \"orderDate\": \"1996-07-04T00:00:00.000Z\",\n    \"requiredDate\": \"1996-08-01T00:00:00.000Z\",\n    \"shippedDate\": \"1996-07-16T00:00:00.000Z\",\n    \"shipViaId\": 3,\n    \"freight\": 32.38,\n    \"name\": \"Vins et alcools Chevalier\",\n    \"address\": \"59 rue de l-Abbaye\",\n    \"city\": \"Reims\",\n    \"region\": null,\n    \"postalCode\": \"51100\",\n    \"country\": \"France\",\n    \"customer\": {\n      \"name\": \"Vins et alcools Chevalier\"\n    },\n    \"details\": [\n      {\n        \"quantity\": 12,\n        \"unitPrice\": 14,\n        \"product\": {\n          \"name\": \"Queso Cabrales\",\n          \"category\": {\n            \"name\": \"Dairy Products\"\n          }\n        }\n      },\n      {\n        \"quantity\": 10,\n        \"unitPrice\": 9.8,\n        \"product\": {\n          \"name\": \"Singaporean Hokkien Fried Mee\",\n          \"category\": {\n            \"name\": \"Grains/Cereals\"\n          }\n        }\n      },\n      {\n        \"quantity\": 5,\n        \"unitPrice\": 34.8,\n        \"product\": {\n          \"name\": \"Mozzarella di Giovanni\",\n          \"category\": {\n            \"name\": \"Dairy Products\"\n          }\n        }\n      }\n    ]\n  }\n]\n```\n\n## Service\n\nYou can access various images at [flaviorita/lambdaorm-svc](https://hub.docker.com/repository/docker/flaviorita/lambdaorm-svc/general)\n\n## Labs\n\nYou can access various labs at [github.com/lambda-orm/lambdaorm-labs](https://github.com/lambda-orm/lambdaorm-labs)\n\n## Documentation\n\n- [Source Code](https://github.com/lambda-orm/lambdaorm-client-node/blob/main/doc/source/README.md)\n- [Lambdaorm Wiki](https://github.com/lambda-orm/lambdaorm/wiki/)\n- [CLI](https://www.npmjs.com/package/lambdaorm-cli)\n- [Labs](https://github.com/lambda-orm/lambdaorm-labs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambda-orm%2Flambdaorm-client-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambda-orm%2Flambdaorm-client-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambda-orm%2Flambdaorm-client-node/lists"}