{"id":18577375,"url":"https://github.com/pjt3591oo/typeorm-m-m-model","last_synced_at":"2025-05-16T01:32:15.790Z","repository":{"id":100333626,"uuid":"391544379","full_name":"pjt3591oo/typeorm-m-m-model","owner":"pjt3591oo","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-01T06:18:28.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T15:25:34.439Z","etag":null,"topics":["orm","typeorm","typescript"],"latest_commit_sha":null,"homepage":"https://blog.naver.com/pjt3591oo/222453288846","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pjt3591oo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-01T06:17:56.000Z","updated_at":"2021-08-01T06:18:58.000Z","dependencies_parsed_at":"2023-05-13T22:15:31.670Z","dependency_job_id":null,"html_url":"https://github.com/pjt3591oo/typeorm-m-m-model","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-m-m-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-m-m-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-m-m-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-m-m-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjt3591oo","download_url":"https://codeload.github.com/pjt3591oo/typeorm-m-m-model/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453420,"owners_count":22073608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["orm","typeorm","typescript"],"created_at":"2024-11-06T23:28:56.971Z","updated_at":"2025-05-16T01:32:15.721Z","avatar_url":"https://github.com/pjt3591oo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Awesome Project Build with TypeORM\n\nSteps to run this project:\n\n1. Run `npm i` command\n2. Setup database settings inside `ormconfig.json` file\n3. Run `npm start` command\n\n```sql\nCREATE DATABASE test;\nUSE test;\n\nCREATE TABLE post (\n\tid INT PRIMARY KEY AUTO_INCREMENT NOT NULL,\n    title VARCHAR(255) NOT NULL\n);\n\nCREATE TABLE tag (\n\tid INT PRIMARY KEY AUTO_INCREMENT NOT NULL,\n    name VARCHAR(255) NOT NULL,\n    color CHAR(6) NOT NULL DEFAULT \"000000\"\n);\n\nCREATE TABLE tagging (\n\tid INT PRIMARY KEY AUTO_INCREMENT NOT NULL,\n    postId INT NOT NULL,\n    tagId INT NOT NULL,\n    FOREIGN KEY (postId) REFERENCES post (id),\n    FOREIGN KEY (tagId) REFERENCES tag (id)\n);\n\nDESC post;\nDESC tag;\nDESC tagging;\n\nSHOW INDEX FROM tagging;\n\n# Insert: post table\nINSERT INTO post(title) VALUES(\"title 1\");\nINSERT INTO post(title) VALUES(\"title 2\");\nINSERT INTO post(title) VALUES(\"title 3\");\nINSERT INTO post(title) VALUES(\"title 4\");\nINSERT INTO post(title) VALUES(\"title 5\");\nINSERT INTO post(title) VALUES(\"title 6\");\nINSERT INTO post(title) VALUES(\"title 7\");\nINSERT INTO post(title) VALUES(\"title 8\");\n\n# Insert: tag\nINSERT INTO tag (name, color) VALUES(\"dev\", \"ff0000\");         # 1\nINSERT INTO tag (name, color) VALUES(\"test\", \"f0f000\");        # 2\nINSERT INTO tag (name, color) VALUES(\"ui/ux\", \"00ff00\");       # 3\nINSERT INTO tag (name, color) VALUES(\"tool\", \"0000ff\");        # 4\nINSERT INTO tag (name, color) VALUES(\"javascript\", \"222222\");  # 5\nINSERT INTO tag (name, color) VALUES(\"python\", \"888888\");      # 6\n\n# Insert: tagging\nINSERT INTO tagging (postId, tagId) VALUES(1, 1);\nINSERT INTO tagging (postId, tagId) VALUES(1, 5);\nINSERT INTO tagging (postId, tagId) VALUES(2, 1);\nINSERT INTO tagging (postId, tagId) VALUES(2, 2);\nINSERT INTO tagging (postId, tagId) VALUES(2, 3);\nINSERT INTO tagging (postId, tagId) VALUES(2, 5);\nINSERT INTO tagging (postId, tagId) VALUES(5, 2);\nINSERT INTO tagging (postId, tagId) VALUES(5, 4);\n\n\nSELECT * FROM post;\nSELECT * FROM tag;\nSELECT * FROM tagging;\n\nEXPLAIN SELECT post.id, post.title, tagging.* FROM post INNER JOIN tagging ON post.id = tagging.postId LIMIT 3;\n\nSELECT \n\tpost.id, post.title, tag.name, tag.color\nFROM \n\tpost\nINNER JOIN \n\ttagging \nINNER JOIN \n\ttag \nON \n\tpost.id = tagging.postId AND tag.id = tagging.tagId\nORDER BY post.id ASC;\n\nSELECT \n\t* \nFROM \n\t post\nLEFT OUTER JOIN tagging \n\tON post.id = tagging.postId \nLEFT OUTER JOIN tag \n\tON tag.id = tagging.tagId\nORDER BY post.id ASC \nLIMIT 3;\n\nSELECT \n\t* \nFROM \n\t (SELECT id, title FROM post limit 3 OFFSET 3) as post\nLEFT OUTER JOIN tagging \n\tON post.id = tagging.postId \nLEFT OUTER JOIN tag \n\tON tag.id = tagging.tagId;\n\nSELECT \n\t* \nFROM \n\t (SELECT * FROM post LIMIT 3) AS post\nLEFT OUTER JOIN tagging \n\tON post.id = tagging.postId \nLEFT OUTER JOIN tag \n\tON tag.id = tagging.tagId\nORDER BY post.id ASC;\n\nSELECT \n\t* \nFROM \n\t post\nLEFT OUTER JOIN tagging \n\tON post.id = tagging.postId \nLEFT OUTER JOIN tag \n\tON tag.id = tagging.tagId\nWHERE post.id in (\n\tSELECT * FROM (\n\t\tSELECT id FROM post LIMIT 3\n    ) as post\n)\nORDER BY post.id ASC;\n\n# 1235 error: Error Code: 1235. This version of MySQL doesn't yet support 'LIMIT \u0026 IN/ALL/ANY/SOME subquery'\nSELECT * FROM post WHERE id IN (SELECT id FROM post LIMIT 3);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjt3591oo%2Ftypeorm-m-m-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjt3591oo%2Ftypeorm-m-m-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjt3591oo%2Ftypeorm-m-m-model/lists"}