From 79481ceb4157fc21c4b3a6c54a17961b90da7716 Mon Sep 17 00:00:00 2001 From: Ryan Poole Date: Sat, 16 Mar 2024 21:40:51 +0000 Subject: [PATCH] Replace badge and minor corrections. --- README.md | 9 ++++----- docs/README.md | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b72c61e..6b402dd 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ [![npm (scoped)](https://img.shields.io/npm/v/@rmp135/sql-ts)](https://www.npmjs.com/package/@rmp135/sql-ts) [![npm](https://img.shields.io/npm/dw/@rmp135/sql-ts)](https://www.npmjs.com/package/@rmp135/sql-ts) -[![Build Status](https://app.travis-ci.com/rmp135/sql-ts.svg?branch=master)](https://app.travis-ci.com/rmp135/sql-ts) - +[![Run Tests](https://github.com/rmp135/sql-ts/actions/workflows/test.yml/badge.svg)](https://github.com/rmp135/sql-ts/actions/workflows/test.yml) @@ -46,7 +45,7 @@ Install into your project using npm / yarn. `npm install @rmp135/sql-ts` -Install your relevant SQL driver. Refer to the [knex documentation](http://knexjs.org/#Installation-node) to determine which driver you should install. For example `npm install mysql`. +Install your relevant SQL driver. Refer to the [knex documentation](http://knexjs.org/#Installation-node) to determine which driver you should install. For example `npm install mysql2`. Create a configuration file, for example `mysql.json`. This will mirror connection details from knex. The `client` property will determine the SQL provider. @@ -54,7 +53,7 @@ The most basic MySQL setup is below, modify as appropriate. Additional options c ```json { - "client":"mysql2", + "client": "mysql2", "connection": { "host": "localhost", "user": "user", @@ -76,5 +75,5 @@ The file will be exported with the filename `Database.ts` (or with the name spec ### Node Module -For finer grained control of the exported types, you can use the node API. See how in the [documentation](https://rmp135.github.io/sql-ts/#/?id=usage). +For finer grained control of the exported types, you can use the node API. See how in the [documentation](https://rmp135.github.io/sql-ts/#/?id=node-module). diff --git a/docs/README.md b/docs/README.md index c5c7081..4c2f075 100644 --- a/docs/README.md +++ b/docs/README.md @@ -123,7 +123,7 @@ const definition = await Client .toTypescript() ``` -To output the database as an object for processing before converting to TypeScript use `toObject`. +To output the database as an object for processing before converting to TypeScript use `toObject` and continue with `fromObject`. ```js const asObject = await Client @@ -134,7 +134,7 @@ const asObject = await Client // Process asObject here. const definition = await Client - .fromObject(asObject) + .fromObject(asObject, config) .toTypescript() ```