(ctx context.Context, logger *zap.Logger, u string)
| 48 | } |
| 49 | |
| 50 | func Connect(ctx context.Context, logger *zap.Logger, u string) (Interface, error) { |
| 51 | if IsRemote(u) { |
| 52 | return NewRemoteDB(client.NewConnectionTo(u)), nil |
| 53 | } |
| 54 | return OpenLocalDB(ctx, logger, u) |
| 55 | } |
| 56 | |
| 57 | func IsRemote(u string) bool { |
| 58 | return strings.HasPrefix(u, "http://") || strings.HasPrefix(u, "https://") |
no test coverage detected