Gathering detailed insights and metrics for @travetto/model-mysql
Gathering detailed insights and metrics for @travetto/model-mysql
Gathering detailed insights and metrics for @travetto/model-mysql
Gathering detailed insights and metrics for @travetto/model-mysql
npm install @travetto/model-mysql
Typescript
Module System
Node Version
NPM Version
TypeScript (92.49%)
HTML (5.93%)
SCSS (1.03%)
JavaScript (0.46%)
Shell (0.09%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
23 Stars
10,030 Commits
3 Forks
2 Watchers
187 Branches
5 Contributors
Updated on Jun 29, 2025
Latest Version
6.0.0
Package Id
@travetto/model-mysql@6.0.0
Unpacked Size
11.06 kB
Size
4.14 kB
File Count
6
NPM Version
10.9.2
Node Version
23.11.0
Published on
May 06, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Install: @travetto/model-mysql
1npm install @travetto/model-mysql 2 3# or 4 5yarn add @travetto/model-mysql
This module provides a MySQL-based implementation for the Data Modeling Support module. This source allows the Data Modeling Support module to read, write and query against SQL databases. In development mode, the SQLModelService will also modify the database schema in real time to minimize impact to development.
The schema generated will not generally map to existing tables as it is attempting to produce a document store like experience on top of a SQL database. Every table generated will have a path_id
which determines it's location in the document hierarchy as well as sub tables will have a parent_path_id
to associate records with the parent values.
Supported features:
Out of the box, by installing the module, everything should be wired up by default.If you need to customize any aspect of the source or config, you can override and register it with the Dependency Injection module.
Code: Wiring up a custom Model Source
1import { AsyncContext } from '@travetto/context'; 2import { InjectableFactory } from '@travetto/di'; 3 4import { SQLModelService, SQLModelConfig } from '@travetto/model-sql'; 5import { MySQLDialect } from '@travetto/model-mysql'; 6 7export class Init { 8 @InjectableFactory({ primary: true }) 9 static getModelService(ctx: AsyncContext, conf: SQLModelConfig) { 10 return new SQLModelService(ctx, conf, new MySQLDialect(ctx, conf)); 11 } 12}
where the SQLModelConfig is defined by:
Code: Structure of SQLModelConfig
1@Config('model.sql') 2export class SQLModelConfig<T extends {} = {}> { 3 /** 4 * Host to connect to 5 */ 6 host = '127.0.0.1'; 7 /** 8 * Default port 9 */ 10 port = 0; 11 /** 12 * Username 13 */ 14 user = ''; 15 /** 16 * Password 17 */ 18 password = ''; 19 /** 20 * Table prefix 21 */ 22 namespace = ''; 23 /** 24 * Database name 25 */ 26 database = 'app'; 27 /** 28 * Auto schema creation 29 */ 30 autoCreate?: boolean; 31 /** 32 * Db version 33 */ 34 version = ''; 35 /** 36 * Raw client options 37 */ 38 options: T = asFull({}); 39}
Additionally, you can see that the class is registered with the @Config annotation, and so these values can be overridden using the standard Configuration resolution paths.
No vulnerabilities found.
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
SAST tool is run on all commits
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More