knox / TypeORM-readme-21.sh
0 likes
0 forks
1 files
Last active
1 | +-------------+--------------+----------------------------+ |
2 | | photo | |
3 | +-------------+--------------+----------------------------+ |
4 | | id | int(11) | PRIMARY KEY AUTO_INCREMENT | |
5 | | name | varchar(100) | | |
6 | | description | text | | |
7 | | filename | varchar(255) | | |
8 | | views | int(11) | | |
9 | | isPublished | boolean | | |
10 | +-------------+--------------+----------------------------+ |
knox / TypeORM-readme-20.ts
0 likes
0 forks
1 files
Last active
1 | import "reflect-metadata" |
2 | import { DataSource } from "typeorm" |
3 | import { Photo } from "./entity/Photo" |
4 | |
5 | const AppDataSource = new DataSource({ |
6 | type: "postgres", |
7 | host: "localhost", |
8 | port: 5432, |
9 | username: "root", |
10 | password: "admin", |
knox / TypeORM-readme-19.ts
0 likes
0 forks
1 files
Last active
1 | import { Entity, Column, PrimaryGeneratedColumn } from "typeorm" |
2 | |
3 | @Entity() |
4 | export class Photo { |
5 | @PrimaryGeneratedColumn() |
6 | id: number |
7 | |
8 | @Column({ |
9 | length: 100, |
10 | }) |
knox / TypeORM-readme-18.ts
0 likes
0 forks
1 files
Last active
1 | import { Entity, Column, PrimaryGeneratedColumn } from "typeorm" |
2 | |
3 | @Entity() |
4 | export class Photo { |
5 | @PrimaryGeneratedColumn() |
6 | id: number |
7 | |
8 | @Column() |
9 | name: string |
knox / TypeORM-readme-17.ts
0 likes
0 forks
1 files
Last active
1 | import { Entity, Column, PrimaryColumn } from "typeorm" |
2 | |
3 | @Entity() |
4 | export class Photo { |
5 | @PrimaryColumn() |
6 | id: number |
7 | |
8 | @Column() |
9 | name: string |
knox / TypeORM-readme-16.ts
0 likes
0 forks
1 files
Last active
1 | import { Entity, Column } from "typeorm" |
2 | |
3 | @Entity() |
4 | export class Photo { |
5 | @Column() |
6 | id: number |
7 | |
8 | @Column() |
9 | name: string |
knox / TypeORM-readme-15.ts
0 likes
0 forks
1 files
Last active
1 | import { Entity } from "typeorm" |
2 | |
3 | @Entity() |
4 | export class Photo { |
5 | id: number |
6 | name: string |
7 | description: string |
8 | filename: string |
9 | views: number |
10 | isPublished: boolean |
knox / TypeORM-readme-14.ts
0 likes
0 forks
1 files
Last active
1 | export class Photo { |
2 | id: number |
3 | name: string |
4 | description: string |
5 | filename: string |
6 | views: number |
7 | isPublished: boolean |
8 | } |
knox / TypeORM-readme-13.sh
0 likes
0 forks
1 files
Last active
1 | npm start |