-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add PostgreSQL, MongoDB Atlas & MongoDB Replica Set Support #255
Conversation
…me, tested and working
…ull not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null
# Conflicts: # common/src/main/java/net/william278/husksync/database/MongoDbDatabase.java # common/src/main/java/net/william278/husksync/database/mongo/MongoCollectionHelper.java # common/src/main/java/net/william278/husksync/database/mongo/MongoConnectionHandler.java
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.
Excellent work - could you update docs?
…ate the config example in docs, also updates mongodb driver bc apparently i was special and very very out of data
Passing all tests, tested for Atlas and Postgres, also adds a safety check for UUID types on mongodb |
dont merge, resolving an issue, appears to be that sasl1 auth is goofd |
String baseURI = "mongodb+srv://{0}:{1}@{2}/?retryWrites=true&w=majority"; | ||
baseURI = baseURI.replace("{0}", credentials.getUsername()); | ||
baseURI = baseURI.replace("{1}", credentials.getPassword()); | ||
baseURI = baseURI.replace("{2}", credentials.getHost()); |
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.
String baseURI = "mongodb+srv://{0}:{1}@{2}/?retryWrites=true&w=majority"; | |
baseURI = baseURI.replace("{0}", credentials.getUsername()); | |
baseURI = baseURI.replace("{1}", credentials.getPassword()); | |
baseURI = baseURI.replace("{2}", credentials.getHost()); | |
final Database.Type type = plugin.getSettings().getDatabase().getType(); | |
if (type == Type.MONGO_ATLAS) { | |
final String uri = String.format("%s://%s:%s@%s/?retryWrites=true&w=majority", | |
type.getProtocol(), credentials.getUsername(), credentials.getPassword(), credentials.getHost()); |
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.
I was going to switch to String.format, but my way makes more sense in the new implementation
MONGO("MongoDB", "mongo"); | ||
POSTGRES("PostgreSQL", "postgresql"), | ||
MONGO("MongoDB", "mongo"), | ||
MONGO_ATLAS("MongoDB", "atlas"); |
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.
MONGO_ATLAS("MongoDB", "atlas"); | |
MONGO_ATLAS("MongoDB", "mongodb+srv"); |
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.
This has been removed in favour of a mongo_settings configuration section
…nly**, allows for MongoDB Atlas, normal MongoDb AND MongoDB replica sets via the parameters in advanced mongo settings, added try and catch on all mongo operations so that it actually throws instead of a cutsie little warning
Breaks config for MongoDB users only |
… step from docs for atlas users
… if using mongodb atlas
Nice work. Thats a better way of doing mongo :) |
Adds support for PostgreSQL.
Uses all better native postgre alternatives
Adds support for srv record based mongodb atlas