New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mythix-orm

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mythix-orm - npm Package Compare versions

Comparing version 1.13.2 to 1.13.3

65

lib/connection/query-generator-base.js
'use strict';
const Nife = require('nife');
/// The base query generator class.

@@ -342,4 +344,67 @@ ///

}
/// Take a <see>Field</see> instance, and generate
/// all index fields for this `field`.
///
/// The `index` property on a <see>Field</see> is used
/// to generate indexes for the field. If a `true` value
/// is encountered in the `index`, it means "this field".
/// If another field name is encountered in the `index` property,
/// then that means "combine this field with the specified field"
/// (to create a combined index). Take the following example:
/// ```javascript
/// ...
/// firstName: {
/// ...
/// index: [
/// true,
/// 'lastName',
/// [ 'email', 'lastName' ],
/// ]
/// }
/// ...
/// ```
/// This will create three indexes for this "firstName" column in the database:
/// 1) `true` = Index the `firstName` column by itself (`idx_users_firstName`)
/// 2) `lastName` = Combine `firstName` and `lastName` to create a combined index (`idx_users_firstName_lastName`)
/// 3) `[ 'email', 'lastName' ]` = Combine `firstName` with `email` and `lastName` to create a combined index involving three columns (`idx_users_firstName_email_lastName`)
/// Using the above example, this method would return the following:
/// ```javascript
/// [
/// [ 'firstName' ],
/// [ 'firstName', 'lastName' ],
/// [ 'firstName', 'email', 'lastName' ],
/// ]
/// ```
/// Which is the list of indexes, and the fields to index for each index.
///
/// Arguments:
/// field: <see>Field</see>
/// The field used to pull the `index` property from.
///
/// Return: Array<Array<string>>
/// Return an array of arrays, where the top-level array lists the
/// indexes, and each sub-array lists the fields to combine into an
/// index.
getIndexFieldsFromFieldIndex(field) {
let indexes = Nife.toArray(field.index).filter((index) => {
if (index === true)
return true;
return (Nife.instanceOf(index, 'string', 'array') && Nife.isNotEmpty(index));
});
if (indexes.length === 0)
return [];
return indexes.map((indexNames) => {
let fieldIndexNames = [ field.fieldName ];
if (indexNames !== true)
fieldIndexNames = fieldIndexNames.concat(indexNames);
return fieldIndexNames;
});
}
}
module.exports = QueryGeneratorBase;

2

package.json
{
"name": "mythix-orm",
"version": "1.13.2",
"version": "1.13.3",
"description": "ORM for Mythix framework",

@@ -5,0 +5,0 @@ "main": "lib/index",

@@ -102,3 +102,3 @@ # mythix-orm

1. The [WIKI](https://github.com/th317erd/mythix-orm/wiki) is still being worked on. Most of the documentation is complete, but there is still a lot more to write. Documentation is the main focus right now. If you have any questions, feel free to drop a line, or open an issue! We will be happy to answer any questions. We aren't "done" until our documentation is pristine.
1. The [WIKI](https://github.com/th317erd/mythix-orm/wiki) is still being worked on. Most of the documentation is complete, but there is still a lot more to write. Documentation is the main focus right now. If you have any questions, feel free to drop a line, or open an issue! We will be happy to answer any questions. We aren't "done" until our documentation is pristine. Feel free to drop us a line in our [Discord](https://discord.gg/DZsAYvym9N) server if you need assistance.
2. Right now there are only database drivers for [SQLite](https://www.npmjs.com/package/mythix-orm-sqlite) and [PostgreSQL](https://www.npmjs.com/package/mythix-orm-postgresql). More are planned, with a Mongo driver likely to land next, followed by MySQL. Help wanted!

@@ -105,0 +105,0 @@ 3. Check out the [Mythix](https://www.npmjs.com/package/mythix) web-app framework. It is also still in active development, and the documentation is poor (to say the least), but it is up and coming, and will soon have fantastic documentation, and even though still in active development is fully functional. To get started try `npx mythix-cli create 'Test App'`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc