Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-jpa

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-jpa - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

2

package.json
{
"name": "js-jpa",
"version": "0.0.17",
"version": "0.0.18",
"description": "jpa for node",

@@ -5,0 +5,0 @@ "author": "stone",

@@ -9,2 +9,5 @@ const Context = require('./Context')

async initialize(config) {
if (config.driver === undefined) {
config.driver = 'mysql'
}
this._logger = config.logger

@@ -11,0 +14,0 @@ if (DRIVERS[config.driver]) {

@@ -1,1 +0,7 @@

module.exports = require('./DataSource')
const DataSource = require('./DataSource')
module.exports.newDataSource = async function (config) {
let dataSource = new DataSource()
await dataSource.initialize(config)
return dataSource
}

@@ -1,3 +0,4 @@

interface DataSource {
initialize(config: JpaConfig): Promise<void>
export function newDataSource(config: JpaConfig): Promise<DataSource>
export interface DataSource {
createContext(): Promise<JpaContext>

@@ -7,3 +8,3 @@ registerRepository(context: JpaContext, repository: Repository): Promise<void>

interface JpaContext {
export interface JpaContext {
query(sql: string, values?: any[]): Promise<any>

@@ -16,3 +17,3 @@ beginTransaction(): Promise<void>

interface JpaConfig {
export interface JpaConfig {
driver?: 'mysql'

@@ -27,3 +28,3 @@ host: string

interface Repository {
export interface Repository {
schema: Schema,

@@ -38,3 +39,3 @@ insert(context: JpaContext, entity: any): Promise<any>

interface Schema {
export interface Schema {
name: string,

@@ -44,3 +45,3 @@ fields: SchemaField[]

interface SchemaField {
export interface SchemaField {
name: string,

@@ -52,3 +53,3 @@ type: string,

interface PageRequest {
export interface PageRequest {
page?: number,

@@ -59,3 +60,3 @@ size?: number,

interface PageOrder {
export interface PageOrder {
name: string,

@@ -65,7 +66,7 @@ asc: boolean

interface Specification {
export interface Specification {
(builder: Builder, entityProxy: EntityProxy): string
}
interface Builder {
export interface Builder {
and(left: string, right: string): string

@@ -75,7 +76,7 @@ or(left: string, right: string): string

interface EntityProxy {
export interface EntityProxy {
[index: string]: EntityFieldProxy
}
interface EntityFieldProxy {
export interface EntityFieldProxy {
equal(value: any): string

@@ -82,0 +83,0 @@ between(min: any, max: any): string

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