(postgresId: string)
| 64 | return newPostgres; |
| 65 | }; |
| 66 | export const findPostgresById = async (postgresId: string) => { |
| 67 | const result = await db.query.postgres.findFirst({ |
| 68 | where: eq(postgres.postgresId, postgresId), |
| 69 | with: { |
| 70 | environment: { |
| 71 | with: { |
| 72 | project: true, |
| 73 | }, |
| 74 | }, |
| 75 | mounts: true, |
| 76 | server: true, |
| 77 | backups: { |
| 78 | with: { |
| 79 | destination: { |
| 80 | columns: { |
| 81 | accessKey: false, |
| 82 | secretAccessKey: false, |
| 83 | }, |
| 84 | }, |
| 85 | deployments: true, |
| 86 | }, |
| 87 | }, |
| 88 | }, |
| 89 | }); |
| 90 | if (!result) { |
| 91 | throw new TRPCError({ |
| 92 | code: "NOT_FOUND", |
| 93 | message: "Postgres not found", |
| 94 | }); |
| 95 | } |
| 96 | return result; |
| 97 | }; |
| 98 | |
| 99 | export const findPostgresByBackupId = async (backupId: string) => { |
| 100 | const result = await db |
no outgoing calls
no test coverage detected