70 Commits

Author SHA1 Message Date
Niels Stinissen
d0b76703cc
feat: add postgres multirange column types (#10627)
* feat: add postgres multirange column types

Adds int4-, int8-, num-, ts-, tstz-, date-multirange column types for postgres
Update docs to include multirange column types
Update functional column-types-postgres test to test multirange column types

Closes: #10556

* style: run npm run format

---------

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2024-01-26 11:33:16 +05:00
YoungKi Lyu
95a7337143
docs: fix orderBy of Spatial columns (#10568) 2023-12-29 15:47:07 +05:00
smith-xyz
d8a2e3730f
feat: mariadb uuid inet4 inet6 column data type support (#9845)
* feat: mariadb inet4, inet6, uuid data type support

* refactor: cleanup unnecessary methods

* style: mysqldriver formatting

* fix: handle length column metadata mariadb uuid

* fix: 8832 test suite to verify errors correctly

* style: fix 8832 test formatting

* fix: 8832 error testing cleanup

* fix: remove defaulting column type feature

* style: fix formatting

* fix: remove unnecessary dbms error test

* fix: remove unused import in test

* fix: ensure defaulting uuid generation column type
2023-04-25 11:36:20 +05:00
Mattias Fjellvang
defb409f56
feat: support time travel queries, upsert, enums, spatial types in cockroachdb (#9128)
* feature: adds support for enum type (fixes #9068)

* temporarily ran package to test on different repo

* playing around - bumped version

* Revert "playing around - bumped version"

This reverts commit 7df4adb3e698419c174c2daee88614f8dafdbb6c.

* Revert "temporarily ran package to test on different repo"

This reverts commit 48f394e8eb32c22fe757010b446c85740bf80b5f.

* feat: add support for geometry data type

* feature: properly hydrate enum array values

* feature: adds support for geography and geometry for cockroachdb

* bugfix: fixes issue with primary generated columns being invalid column type (fixes #8532)

* Revert "bugfix: fixes issue with primary generated columns being invalid column type (fixes #8532)"

This reverts commit e00cdb090638d34668e3e10acd5f8267fe3bd028.

* bugfix: type casts to string when using ANY

* feature: cast geometry/geography to geojson

* feature: added references to srid

* bugfix: prevent error if trying to close already closed connection

* feature: added cockrachodb as part of postgres family

* feature: ensures support for spatial columns for cockroachdb

* feature: adds support for UPSERT for CockroachDB (fixes #9199)

* minor: added TODO; unsure how to achieve this

* feature: adds support for time travelling queries for cockroachdb

* bugfix: only run time travel query on SELECT statements

* refactor: changed UsertType from 'upsert' to 'primary-key' since this is more logical

* feature: added posibility to set timeTravelQuery to false, instead of the parameter function; help for disabling time travel queries during tests

* feature: allow timeTravelQueries in find* queries

* bugfix: when using timetravel queries with joinAttributes it now prevents error 'AS OF SYSTEM TIME must be in top level' error

* lint

* minor fix

* fixed failing test

* implemented ENUM type;
added tests;

* fixed failing tests

* fixed failing test

* fixed spatial types synchronization;
implemented spatial indices;
added tests for spatial columns;

* refactored Time Travel Query functionality;
removed TTQ from find options;
added tests for TTQ;

* added docs for Time Travel Queries

* minor changes

* added GeoJSON types;
other minor fixes;

* updated docs

* updated docs

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2023-01-03 19:25:22 +05:00
Bogdan Crisan
64674e60a2
docs: fix wrong function used in entity documentation (#9280)
Previously, the documentation said that it's using the `findOne`
function, but it used the `findBy` and `findOneBy` functions. In order
to be coherent, this commit changes all those to `findOneBy`.
2022-08-24 20:15:35 +05:00
AlexMesser
62518ae122
feat: Cloud Spanner support (#8730)
* working on Cloud Spanner driver implementation

* working on DDL synchronization

* working on DDL synchronization

* fixed failing test

* working on VIEW implementation

* fixed query parameters

* lint

* added transaction support;
added streaming support;

* fixed column types

* fixes after merge

* prettier

* added support for generated columns

* added escaping for distinct alias

* working on generated columns

* changed failing test

* updated tests for Spanner;
bugfixes;

* updated tests for Spanner;
bugfixes;

* updated tests for Spanner;
bugfixes;

* fixed failing test

* fixed failing test

* fixing failing tests

* fixing failing tests

* fixing failing tests

* added support for typeorm-generated uuid;
fixed caching;

* fixing failing tests

* fixing failing tests

* fixing failing tests

* fixing failing tests

* fixing failing tests

* fixing failing tests

* debugging failing test

* debugging failing test

* fixed bug in @PrimaryColumn decorator

* fixed failing tests

* fixed VIEW functionality;
fixed failing tests;

* updated docs
2022-04-12 17:31:57 +05:00
Umed Khudoiberdiev
3b8a031ece
0.3.0 (#8616)
* added find options and new option relationLoadStrategy

* find now returns null instead of undefined; removed primary relations support; bugfixing; added some changes and tests from next branch;

* added typename to connection options; added data loader types, lot of deprecations; new es2020 emit by tsc; new custom repositories syntax

* applied lint fixing

* replaced some instanceof checks

* reverting docker compose image versions

* optimizing imports

* reverting back some instanceof checks to prevent compiler errors

* downgrading es compilation version

* docs: remove "primary" from relation options (#8619)

remove ex-line 26 for being deprecated in 0.3.0:
"* `primary: boolean` - Indicates whether this relation's column will be a primary column or not."

* Revert "reverting back some instanceof checks to prevent compiler errors"

This reverts commit 7bf12a39e2297d097aa2a42989afd0e9e4f49bb0.

* Revert "optimizing imports"

This reverts commit 7588ac14e4f1bf1a82e3b7883134b9c2c8ae5f3f.

* Revert "replaced some instanceof checks"

This reverts commit bfa5a2d706f697ed1c1beb38b4455c0d33121e5a.

* fixing few comments

* removing transaction decorators

* this test is invalid - it's not clear why the hell getTreeRepository will throw an error and it's not clear what kind of error its going to throw

* addded mixed list support in connection options

* trying to fix oracle length issue

* lintfix

* removed shorten usages

* added named entity target support to the connection

* fixing entity target support in relation options via entity schema

* debugging oracle issue

* fixed issue with alias not being shortened in many to many alias cases

* some day we'll have a prettier.

* fixing oracle tests

* fixing oracle failing test

* removed "null" support in where expressions; fixed softDelete and restore incorrect usages

* renamed FindConditions to FindOptionsWhere

* version bump

* docs: update loading relation in find method (v 0.3.0) (#8621)

* docs: update relation definition method

Update the method that allows loading a specific relation inside the find method.
This method is found on the one-to-one-relations page.
Change `const users = await userRepository.find({ relations: ["profile"] });` to `const users = await userRepository.find({ relations: {profile: true});`.

* fix formatting

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>

* docs: change relations option definition (#8620)

* docs: change relations option definition

change line 139 from 
`const users = await connection.getRepository(User).find({ relations: ["profile", "photos", "videos"] });`
to
`const users = await connection.getRepository(User).find({ relations: { profile: true, photos: true, videos: true] });`
to reflect version 0.3.0 changes

* docs: change relations option definition

Rectified a type on line 139
from:
`const users = await connection.getRepository(User).find({ relations: { profile: true, photos: true, videos: true] });`
to
`const users = await connection.getRepository(User).find({ relations: { profile: true, photos: true, videos: true} });`

* formatting

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>

* lint

* improved find options types

* fixed types and removed nonnever because it causes circual issue for some reason

* docs: update entitymanager definition (#8623)

* docs: update entitymanager definition

change the "What is EntityManager?" page to be up-to-date with v 0.3.0

1. line 6 changes from
`You can access the entity manager via 'getManager()' or from 'Connection'.`
to 
`You can access the entity manager via DataSource's manager.`

2. the import on `getManager` in line 10 becomes `Manager` that the user have configured beforehand:
`import {getManager} from "typeorm";`
becomes 
`import {Manager} from "./config/DataSource";`

3.change entityManager definition in line 13:
from
`const entityManager = getManager(); // you can also get it via getConnection().manager`
to
`const entityManager = Manager;`

* docs: update entitymanager definition

changed line 10 from: 
`import {Manager} from "./config/DataSource";`
to
`import {DataSource} from "typeorm";`

and changed line 13 and 14 from: 
`const entityManager = Manager;`
`const user = await entityManager.findOne(User, 1);`
to 
`const myDataSource = new DataSource({ /*...*/ });`
`const user = await myDataSource.manager.findOne(User, 1);`

for a simpler way of describing the origin of DataSource and how it works.

* In return type doesn't seem to work in all cases

* feat: mssql v7 support (#8592)

Adds support for v7 of the mssql library as v6 is EOL. This also makes use of the new toReadableStream method on requests to return a native stream where required.

* fix: prefix relation id columns contained in embedded entities (#6977) (#7432)

* fix: prefix relation id columns contained in embedded entities (#6977)

Searches embedded entity columns for relation ID column if relation column
is in embedded entity. If not found, creates new relation ID with embedded
metadata set to match the relation column.

fixes: #2254
fixes: #3132
fixes: #3226
fixes: #6977

* test: prefix subcounters sub-entity with "sub" to fit in 30 character identifier for oracle

Problem introduced with #6981

* fix: find by Date object in sqlite driver (#7538)

* fix: find by Date object in sqlite driver

In sqlite, Date objects are persisted as UtcDatetimeString.
But a Date object parameter was escaped with .toISOString(), making such queries impossible.
This commit aligns both transforms.
This bug does *not* apply to better-sql where you can only bind numbers, strings, bigints, buffers,
and null.
This is breaking for when the user inserted their dates manually as ISO and relied on this old
maltransformation, after this their find()s by Date won't work anymore.

BREAKING CHANGE: Change Date serialization in selects
Closes: #2286

* add failing test

* fix: find by Date object in sqlite driver (with query builder)

Also consider query builder parameter escaping

* test: add test for 3426

Co-authored-by: James Ward <james@notjam.es>

* manually ported changes from #7796

* updated changelog

* fixes after merge

* new findOne syntax

* new find* syntax

* new find* syntax

* lint

* tsc version bump

* tsc version bump and fixed mongodb issues

* moved date fns into non dev deps

* returned oracledb dep into place

* removed lock files

* returned lock files back

* eslint upgrade

* fixing mongodb issue

* fixing mongodb issue

* test: keep junction aliases short (#8637)

Tests a fix for an issue where junction aliases (e.g. in many-to-many relations)
are not unique because they are too long and thus truncated by the driver.

Closes: #8627
Related to: 76cee41dcf1c146d02715c7f48fed33672d28c67

* fixing mongodb issues

* fixing sqlite test

* fixing sqlite test

* fixing sqlite test

* fixing mongodb test

* fixing entity schema tests

* fixing entity schema tests

* merged latest master

* removed driver instanceof checks

* removed function instanceof checks

* removed Object instanceof checks

* removing instanceof checks...

* fixing instanceof checks

* added InstanceChecker to remove remaining instanceof checks

* fixed failing test

* linting

* fixing failing test

* version bump

* compiler fixes

* Connection type usages replace to DataSource

* updated dev deps

* updated deps, add prettier, removed oracledb due to m1 issue

* chalk downgrade

* fixing failing test

* applied prettier formatting

* replaced eslint to prettier

* okay I think we can call it lint

* fixing linting

* fixed prettier introduced compiler bug

* fixed failing test

* prettier;

* fixed failing test

* alias shortening only for junction tables;
fixed failing tests;

* changed aurora db names and reverted change of junction table name shorten algorithm

* format

* removed platform from docker compose

* made numeric parameters to not use parameters to prevent parameters number limit issue. Also enabled shorten only for junction tables

* fixing test

* fixing returning columns bugs

* fixing test

* fixed returning issue

* fixing merge conflicts

* updating documentation

* working on docs / improving api

* working on docs

* fixed isConnected issue

* re-worked commands

* commenting cli command tests for now

* commenting cli command tests for now

* removed platform

* returned Connection back

* refactor: export tree repository helper methods (#8753)

* Migrated protected tree methods to util class

* Added tree repository extend override

* Ran prettier format

* merge master into 0.3.0

Co-authored-by: Bitcollage <serkan.sipahi@yahoo.de>

* working on documentation

Co-authored-by: Bilel Taktak <47742269+Parsath@users.noreply.github.com>
Co-authored-by: Salah Azzouz <52634440+Salah-Azzouz@users.noreply.github.com>
Co-authored-by: Daniel Hensby <dhensby@users.noreply.github.com>
Co-authored-by: Nebojša Cvetković <nebkat@gmail.com>
Co-authored-by: Philip Waritschlager <philip+github@waritschlager.de>
Co-authored-by: James Ward <james@notjam.es>
Co-authored-by: Felix Gohla <37421906+felix-gohla@users.noreply.github.com>
Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
Co-authored-by: Jimmy Chen <50786287+Q16solver@users.noreply.github.com>
Co-authored-by: Bitcollage <serkan.sipahi@yahoo.de>
2022-03-17 21:01:45 +05:00
Dimitris Halatsis
969af958ba
feat: Postgres IDENTITY Column support (#7741)
* feat: extend column options interfaces to also support Postgres10+ Identity generationStrategy

* feat: extend PrimaryGeneratedColumn support for Postgres10+ identity

* feat: update buildCreateColumnSql with Postgres10+ IDENTITY support

* feat: update loadTables for Postgres10+ IDENTITY column recognition

* doc: add description of identity support for PrimaryGeneratedColumn

* test: add test for SQL of table with IDENTITY COLUMN in Postgres 10+

* feat: take identity generation type into consideration when checking for changed column

* fix: better non behavior changing way of checking for identity column

* chore: rebase and resolve PR conversations
2021-11-10 00:00:31 +05:00
Joren Vandeweyer
acc7994ce1
docs: Added enumName column option (#7570)
Added minor documentation for #4824
2021-04-17 14:40:51 +05:00
Tom Rodrigues
9ce3f78ad1
docs: fix typo in entities.md (#7491)
Fixes small grammar issue.
2021-03-27 11:25:14 +05:00
Rohan Talip
82df614c6e
docs: fix typo in entities.md : hustle --> hassle (#6963) 2020-10-22 20:01:34 -04:00
Manuel Nucci
f9caf5d90b
docs: fix decorators in example class using adjacency list (#6932)
Closes: #6527
2020-10-18 21:19:26 -04:00
Thomas Sawkins
43a7386719
feat: implement postgres ltree (#6480)
This new feature implements support for the postgres extension ltree

Closes: #4193
2020-08-02 19:34:01 +05:00
golergka
6a6cc7b90a
docs: note about bigint type being mapped to a string (#5730) 2020-05-16 19:17:54 +03:00
Sam Bender
52a561966e
docs: add @DeleteDateColumn to special columns docs (#6016)
Mostly copied text from the decorator reference: https://github.com/typeorm/typeorm/blob/master/docs/decorator-reference.md#deletedatecolumn
2020-05-16 03:03:35 +03:00
Tim Pap
2bb0e398f9 docs: fix broken link (#4834)
The `decorator-reference` link is broken
see: https://typeorm.io/#/entities
2019-10-13 23:09:37 +05:00
hauau
19e21795d0 feat: add set datatype support for MySQL/MariaDB (#4538)
Set possible values defined using existing enum column option.
Sets are implemented as arrays.

Closes: #2779
2019-09-05 22:38:54 +05:00
Liau Jian Jie
b6d62788ea feat: add multi-dimensional cube support for PostgreSQL (#4378) 2019-07-21 16:10:53 +02:00
Paul Fitzpatrick
afe59ff1ed deprecate readonly in favor of update+insert 2019-05-02 17:20:01 -04:00
Paul Fitzpatrick
ac3f2c135d adds an option to control whether columns are inserted by default
This adds an `insert` option, analogous to the existing `select`
and `readonly` options, for use in the `Column` decorator.  Just
like a column specified with `@Column({select: false})` will not
be selected by default in queries, and a column with
`@Column({readonly: true;})` will not be `UPDATE`d,
a column specified with `@Column({insert: false})`
will not be inserted by default in `INSERT`s.

I believe this fixes #85, and is relevant to (though not the same as)
the work in #2150.
2019-05-02 17:19:27 -04:00
Sammy Teillet
4b8fdf9421 docs: Improve docs for value transformers 2019-04-24 09:43:02 +02:00
Zotov Dmitry
e174ebd40d Merge branch 'master' into crdb
# Conflicts:
#	package-lock.json
#	src/query-builder/DeleteQueryBuilder.ts
#	test/functional/query-builder/delete/query-builder-delete.ts
2019-02-21 12:39:56 +05:00
Ashish Mukarne
94313257d8
Update entities.md 2019-02-16 12:57:52 +05:30
Zotov Dmitry
d051626bc8 updated docs; 2019-02-15 18:20:40 +05:00
Bernd L
040e857644
Grammar stuff
This changes "a entity" to "an entity" because it sounds better.

And it adds "The" right before "Example below".
2019-02-03 01:14:57 +01:00
Vladimir Poluch
ebfbb009e2 fix(postgres,mysql): better support for enum and enum array 2019-01-13 16:08:46 +01:00
Vladimir Poluch
a293885e11 chore(mysql): sync mysql data types with mysql docs 2018-12-22 14:49:47 +01:00
Umed Khudoiberdiev
a9c41ab14d
Merge pull request #2832 from asztal/patch-1
Fix typo in closure table section of entities.md
2018-10-20 16:14:32 +05:00
Simon Friis Vindum
001046f765
Fix example using numeric type with length type parameter 2018-10-15 11:15:49 +02:00
Nico Greenarry
e94c4d566f
docs: Fix separated bulleted list
A linebreak was making a single bulleted list look like two separate lists.
2018-10-03 07:00:03 -07:00
Lee Houghton
d1eeca1a3e
Fix typo in entities.md
This now matches the example in http://typeorm.io/#/tree-entities (although that one doesn't show `@TreeLevelColumn`, despite importing it).
2018-09-22 10:38:19 +01:00
Jen Garcia
ae1d3f8456 Add Expo platform support to documentation 2018-07-04 15:46:19 -04:00
Umed Khudoiberdiev
2e069ce6a8
adding missing links 2018-07-03 23:03:16 +05:00
Seth Fitzsimmons
e1f6aa4795 Doc spatial columns 2018-07-03 10:32:52 -07:00
merong245
c9a5c54c62
Merge branch 'master' into branch-name 2018-06-07 22:04:15 +09:00
LeeJunHyeok
5ea9a85f14 modify typing errors 2018-06-06 22:25:07 +09:00
Shenghan Gao
5f78723199 add mssql rowversion to entities.md
- also format the entites.md
2018-05-23 21:45:02 -07:00
Zotov Dmitry
bf92ac1d88 working on docs; 2018-04-19 15:00:36 +05:00
Zotov Dmitry
fc9526517b working on docs; 2018-04-18 17:26:53 +05:00
Daniel Lang
3a8bb3b3b2 removed websql and systemjs
Support for WebSql and System.js have has been dropped after a
discussion (#1918) as they are cannot be fully supported and aren't used
that much
2018-04-12 17:23:00 +02:00
Zotov Dmitry
da58c58be4 Merge branch 'next' into schema-builder-refactoring
Conflicts:
	package-lock.json
2018-02-20 17:16:28 +05:00
Umed Khudoiberdiev
43f89d49a3 Merge branch 'master' into next
* master:
  updated changelog
  fixed #1504
  removed only test
  Update one-to-one-relations.md
  Handle SQLite in-memory db in ConnectionOptionsReader
  Update eager-and-lazy-relations.md
  Update eager-and-lazy-relations.md
  Update issue-1569.ts
  skipped test #1569 (need to fix in @next)
  Update entities.md
  Update entities.md
  added test for #1581
  Update select-query-builder.md
  create failing test case for issue 1569

# Conflicts:
#	docs/eager-and-lazy-relations.md
2018-02-20 13:41:22 +05:00
Umed Khudoiberdiev
6567da9c2d
Update entities.md 2018-02-16 10:05:59 +05:00
cedrick mandocdoc
b3c4a12d3c Update entities.md 2018-02-15 20:12:40 +08:00
Zotov Dmitry
d6edc142fd Merge branch 'next' into schema-builder-refactoring
Conflicts:
	CHANGELOG.md
	docs/entities.md
	gulpfile.ts
	package-lock.json
	src/connection/Connection.ts
	src/driver/oracle/OracleDriver.ts
	src/driver/postgres/PostgresDriver.ts
	src/metadata-args/MetadataArgsStorage.ts
	src/metadata/EntityMetadata.ts
	src/persistence/SubjectExecutor.ts
	src/query-builder/UpdateQueryBuilder.ts
	test/functional/sqljs/auto-save.ts
2018-02-08 17:53:06 +05:00
Zotov Dmitry
b8c782e8c3 fixing falling tests; 2018-02-08 17:38:56 +05:00
Umed Khudoiberdiev
8ef1695311 Merge branch 'master' into next
* master: (57 commits)
  update typescript to 2.7
  removing repeat types at postgres and sqlite
  Prevent transforms breaking on datetime types (closes #1140)
  fixing repeating column types for mysql / mariadb
  loose -> lose
  loose -> loss
  loose -> lose
  Updated the hidden column to reflect the query
  version bump
  Fix typo in connection-options.md
  Fixed typo in mongodb.md
  Update support.md
  Update support.md
  Update roadmap.md
  Update decorator-reference.md
  Update faq.md
  Update sequelize-migration.md
  Update example-with-express.md
  Update active-record-data-mapper.md
  Update using-cli.md
  ...

# Conflicts:
#	CHANGELOG.md
#	README.md
#	docs/relations.md
#	docs/roadmap.md
#	docs/tree-entities.md
#	package-lock.json
#	package.json
#	src/query-builder/UpdateQueryBuilder.ts
#	test/functional/entity-metadata-validator/basic/entity-metadata-validator.ts
#	test/functional/sqljs/auto-save.ts
2018-02-06 12:17:33 +05:00
Pablo Carrera Estrada
35dd65f0d7
removing repeat types at postgres and sqlite
repeat types
2018-02-05 10:25:23 -05:00
Pablo Carrera Estrada
956a5fd36f
fixing repeating column types for mysql / mariadb
removing repeated types of `int`, `tinyint`, `smallint`, `mediumint`, `bigint` at  column types for mysql / mariadb
2018-01-31 23:46:07 -05:00
Crutchcorn
d33e4c99ec Update documentation for select, NULL, and subscribers 2018-01-25 19:02:26 -08:00