본문 바로가기
오류 해결

Error: DataSource is not set for this entity. at Function.getRepository / 폴더구조에서 ** 과 * 의 뜻

by 질서정연_ 2023. 7. 26.

Error: DataSource is not set for this entity.
    at Function.getRepository

 

typeorm 에서 각 entity 들은 data source options 에 등록 되어있어야한다. 

 

 

  entities: ["src/entities/*.ts"],

 

이렇게 해 주니까 잘 됐다.

 

 

Entities - typeorm

int, int2, int4, int8, smallint, integer, bigint, decimal, numeric, real, float, float4, float8, double precision, money, character varying, varchar, character, char, text, citext, hstore, bytea, bit, varbit, bit varying, timetz, timestamptz, timestamp, ti

orkhan.gitbook.io

https://orkhan.gitbook.io/typeorm/docs/entities

 

저런 folder address 에서

 

src/js/**/*.js

 

이런 ** 이랑 * 이 무슨뜻인지 궁금해서 찾아봤다.

 

The double star in this case means all folders within the current folder, with the current folder being src/js

So in full, find all files with a .js extension, in all subfolders of src/js

 

** 은 현재 폴더의 모든 폴더를 뜻한다.

*.js 은 js 확장자의 모든 파일들을 뜻한다.

 

그래서 src/js/**/*.js 

는 src/js 의 모든 서브폴더의 모든 js확장자 파일을 뜻한다.

 

The double asterisks are placeholders or instructions to the recursive interpreter to go through the files and folders.

It is a simple, recursive wildcard while only one asterisk means all without recursion.

'**/*.js'; All files with the extension .js from here onwards.

'lib/**/*.js'; All files with the extension .js in the folder lib and its subfolders.

'js/**'; All files in the folder js and its subfolders.

 

 

https://stackoverflow.com/questions/46547540/meaning-of-a-double-star-in-a-file-path

 

Meaning of a double star (**) in a file path

I was reading here on Stack Overflow about ** in a path, as in this example: src/js/**/*.js I would like to ask if " ** " means "any nested directory" please?!

stackoverflow.com

 

댓글