npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@volcanicminds/typeorm

v0.8.0

Published

TypeORM for the volcanic (minds) backend

Downloads

228

Readme

License: MIT opensource volcanic-typeorm npm

volcanic-database-typeorm

Based on

Based on TypeORM (GitHub).

And, what you see in package.json.

How to install

yarn add @volcanicminds/typeorm

It's possible use this module with module @volcanicminds/backend

How to upgrade packages

yarn upgrade-deps

Postgres (data types)

typeorm postgres: database schema / column types

postgres data types: all postgres data types: numeric

Entities

For example, under /src/entities create the following:

// player.e.ts

import { Entity, Column, Index, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm'

@Entity()
export class Player {
  @PrimaryGeneratedColumn('uuid')
  id: number

  @Index()
  @Column() // default: nullable false
  name: string

  @Column({ type: 'varchar', array: true, nullable: true })
  roles: string[]

  @CreateDateColumn()
  createdAt: Date

  @UpdateDateColumn()
  updatedAt: Date
}

For more info and possibilities see typeorm decorators

Enviroment

# or automatically use LOG_LEVEL
LOG_DB_LEVEL=warn
LOG_COLORIZE=true

Log levels:

  • trace: useful and useless messages, verbose mode
  • debug: well, for debugging purposes.. you know what I mean
  • info: minimal logs necessary for understand that everything is working fine
  • warn: useful warnings if the environment is controlled
  • error: print out errors even if not blocking/fatal errors
  • fatal: ok you are dead now, but you want to know

Query: Operators

It's possible use some operators:

| Operator | Description | Datatypes | Example | | ---------- | ---------------------------------- | ------------- | -------------------- | | null | Is null | all | field:null=true | | notNull | Not is null | all | field:notNull=true | | in | Included in an array | all | field:in=A,B,C | | nin | Not included in an array | all | field:nin=A,B,C | | gt | Greater than | numeric, date | field:gt=10 | | ge | Greater than or equals to | numeric, date | field:ge=10 | | lt | Less than | numeric, date | field:lt=10 | | le | Less than or equals to | numeric, date | field:le=10 | | between | Is between A and B | numeric, date | field:between=A,B | | like | Like with wildcard % | text | field:like=va%ue | | contains | Contains | text | field:contains=alu | | ncontains | Not contains | text | field:ncontains=xyz | | starts | Starts with | text | field:starts=val | | ends | Ends with | text | field:ends=lue | | eq | Equals to | all | field:eq=value | | neq | Not equals to | all | field:neq=xyz | | likei | Like with wildcard % (ignore-case) | text | field:likei=va%ue | | containsi | Contains (ignore-case) | text | field:containsi=alu | | ncontainsi | Not contains (ignore-case) | text | field:ncontainsi=xyz | | startsi | Starts with (ignore-case) | text | field:startsi=val | | endsi | Ends with (ignore-case) | text | field:endsi=lue | | eqi | Equals to (ignore-case) | text | field:eqi=value | | neqi | Not equals to (ignore-case) | text | field:neqi=xyz |

The expression field=value is equals to field:eq=value

Pay attention: Some datatypes, like UUID, are special types and have possibility to use only specific operator (for example: eq, null, notNull, ..)

Logging

Use Pino logger if in your project you have a global.log with a valid instance.