-
Notifications
You must be signed in to change notification settings - Fork 46
feat(registry): add PostgreSQL support #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a857226
to
36a5290
Compare
ac11db1
to
ef598ad
Compare
5aaf05f
to
0aefd67
Compare
0aefd67
to
752d5d5
Compare
return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, parseJSON(value)])) as T; | ||
} else { | ||
return parse(value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
752d5d5
to
cb59916
Compare
|
||
export default async (withAuth: boolean = true): Promise<Application> => { | ||
loadPlugins(); | ||
logConnectionString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to log connection string ?
import { retrieveAppRouteFromDB } from './getAppRoute'; | ||
import { transformSpecialRoutesForDB } from '../services/transformSpecialRoutes'; | ||
import { getJoiErr, joiErrorToResponse } from '../../util/helpers'; | ||
import { defined, getJoiErr, joiErrorToResponse } from '../../util/helpers'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defined helper looks like a kind of magic for me. What is its purpose ?
|
||
export async function up(knex: Knex): Promise<any> { | ||
if (isMySQL(knex)) { | ||
if (!isSqlite(knex)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it makes sense to remove SqlLite at all to not support this logical branch ?
import type Knex from 'knex'; | ||
import { isPostgres } from '../util/db'; | ||
|
||
export function syncSequencePlugin(knex: typeof Knex): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems a little hacky, why does it needed?
import app from './app'; | ||
import server from './server'; | ||
import { getLogger } from './util/logger'; | ||
|
||
process.env.NODE_CONFIG_DIR = path.resolve(__dirname, '../config'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure that this line is not needed? It seems that it resolves to a correct newrelic config file
@@ -2,7 +2,7 @@ import { Knex } from 'knex'; | |||
|
|||
export async function up(knex: Knex): Promise<any> { | |||
return knex.schema.table('routes', (table) => { | |||
table.text('meta'); | |||
table.json('meta'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure that we can change existing migrations... if you expect json next in the code, it might not be applied to real DBs
loadPlugins(); | ||
new AssetsDiscovery('apps').start(interval); | ||
new AssetsDiscovery('shared_libs').start(interval); | ||
(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async seems unused here
@@ -63,11 +63,11 @@ export enum OnPropsUpdateValues { | |||
Update = 'update', | |||
} | |||
|
|||
type SettingValue = string | boolean | TrailingSlashValues | string[]; | |||
type SettingValue = string | number | boolean | string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrailingSlashValues seems missed, but it should be there
err.message.includes(v), | ||
) | ||
) { | ||
throw new ForeignConstraintError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need message here, otherwise will be verry hard to debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What for do we need this file?
dd38744
to
24ed823
Compare
configure local development for using different databases adapt migrations to PostgreSQL adapt codebase for using PostgreSQL normalize api responses between databases extend and fix typings prepare CI for test running on multiple databases add configuration via dotenv (for local development)
24ed823
to
2eeaf83
Compare
Coverage ReportIlc/serverCommit SHA:6c2109bcdefa0f63039f93645b1044d0ba759c51 Test coverage results 🧪
File details
Ilc/clientCommit SHA:6c2109bcdefa0f63039f93645b1044d0ba759c51 Test coverage results 🧪
File details
RegistryCommit SHA:6c2109bcdefa0f63039f93645b1044d0ba759c51 Test coverage results 🧪
File details
|
configure local development for using different databases
adapt migrations to PostgreSQL
adapt codebase for using PostgreSQL
normalize api responses between databases
extend and fix typings
prepare CI for test running on multiple databases
add configuration via dotenv (for local development)