Skip to content

Commit

Permalink
add version field and don't get fancy with java
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo committed Apr 15, 2024
1 parent be93837 commit 71631c6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Sdk" ADD COLUMN "version" TEXT;
2 changes: 2 additions & 0 deletions servers/fdr/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ model Sdk {
// Optional for backcompat
// Package name used by registry (e.g. @velllum/api or com.vellum.ai:vellum)
package String?
// Optional for backcompat
version String?
language Language
sdk Bytes
createdAt DateTime @default(now())
Expand Down
11 changes: 1 addition & 10 deletions servers/fdr/src/db/sdk/SdkDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,6 @@ export class SdkDaoImpl implements SdkDao {
case Language.RUBY:
id = SdkIdFactory.fromRuby({ gem: sdkPackage, version });
break;
case Language.JAVA: {
// TODO(armandobelardo): confirm how to do java here
const splitCoord = sdkPackage.split(":");
if (splitCoord.length === 2) {
const group = sdkPackage.split(":")[0];
const artifact = sdkPackage.split(":")[1];
id = SdkIdFactory.fromJava({ group, artifact, version });
}
break;
}
default:
break;
}
Expand All @@ -122,6 +112,7 @@ export class SdkDaoImpl implements SdkDao {
},
where: {
package: sdkPackage,
version,
language,
},
orderBy: {
Expand Down
1 change: 1 addition & 0 deletions servers/fdr/src/db/snippets/SnippetsDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export class SnippetsDaoImpl implements SnippetsDao {
data: {
id: sdkInfo.id,
package: getPackageNameFromSdkSnippetsCreate(storeSnippetsInfo.sdk),
version: storeSnippetsInfo.sdk.sdk.version,
language: sdkInfo.language,
sdk: writeBuffer(storeSnippetsInfo.sdk.sdk),
},
Expand Down

0 comments on commit 71631c6

Please sign in to comment.