Skip to content

Conversation

@SakuraIsayeki
Copy link
Contributor

Implemented connection strings as an alternative configuration method for setting up and customizing database connections. If supplied, they override any other database config property for the active provider.

Allows specifying complete connection strings for SQLite, MySQL, and Postgres, overriding individual host and credential properties when specified, to provide more flexible database configuration.
Allows override of default database connection parameters by providing explicit connection strings for SQLite, MySQL, and PostgreSQL, improving configuration flexibility and setup robustness. Includes refactoring path handling and directory creation for SQLite files.
@hakusaro
Copy link
Member

@SakuraIsayeki can you provide example connection strings in the code somewhere e.g., as a comment so people know what they should look like?

@SakuraIsayeki
Copy link
Contributor Author

@SakuraIsayeki can you provide example connection strings in the code somewhere e.g., as a comment so people know what they should look like?

Thanks for pointing out this oversight. Luckily I came prepared to document the use ;)

Example connection strings can be found over at this handy website named connectionstrings.com. For the providers implemented within TShock, here are the relevant example pages :

Should these be included in code comments, or in documentation on the wiki ? (or both, come to think of it :D)

Provides links to example connection string formats for SQLite, MySQL, and Postgres to assist users in configuring database connections more effectively.
@hakusaro
Copy link
Member

Should these be included in code comments, or in documentation on the wiki ? (or both, come to think of it :D)

Not comfortable with links to things that will eventually die

@SakuraIsayeki
Copy link
Contributor Author

Should these be included in code comments, or in documentation on the wiki ? (or both, come to think of it :D)

Not comfortable with links to things that will eventually die

9 times out of 10, I'd fully agree with you on that one, @hakusaro.
However, this website has a solid track record going back to 1998 (source: https://www.connectionstrings.com/retrospective/), and is pretty much taken as granted by most dev resources out there (including Microsoft IIRC one of their ASP.NET Docs on setting up MSSQL).

I'll stake my own responsibility on maintaining this one piece of docs, and eventually, should this website ever go down, I'll copy over most of it to our own wiki.

Kurz : Could we let this one slide, on account of sheer stability ?

@pacenadhif778
Copy link

Haruskah ini disertakan dalam komentar kode, atau dalam dokumentasi di wiki? (atau keduanya, kalau dipikir-pikir :D)

Tidak nyaman dengan tautan ke hal-hal yang pada akhirnya akan mati

9 dari 10 kali, saya sepenuhnya setuju dengan Anda dalam hal itu,@hakusaro. Namun, situs web ini memiliki rekam jejak yang solid sejak tahun 1998 (sumber: https://www.connectionstrings.com/retrospective/ ), dan cukup diterima begitu saja oleh sebagian besar sumber daya pengembangan di luar sana (termasuk Microsoft IIRC salah satu Dokumen ASP.NET mereka tentang pengaturan MSSQL).

Saya akan mempertaruhkan tanggung jawab saya sendiri dalam memelihara satu bagian dokumen ini, dan akhirnya, jika situs web ini ditutup, saya akan menyalin sebagian besarnya ke wiki kita sendiri.

Kurz: Bisakah kita lupakan saja yang ini, demi stabilitas semata?

Sorry if I’m being too forward, but I think it would be much better if everything was compiled into a proper wiki. For amateurs like us, it can be quite confusing to navigate the current setup. A wiki would make the guide clearer and more practical, especially if it includes examples and is designed to be accessible for all users, regardless of their experience level.

@SakuraIsayeki
Copy link
Contributor Author

Sorry if I’m being too forward, but I think it would be much better if everything was compiled into a proper wiki. For amateurs like us, it can be quite confusing to navigate the current setup. A wiki would make the guide clearer and more practical, especially if it includes examples and is designed to be accessible for all users, regardless of their experience level.

Fully agree with you on this one. I do plan on adding some examples in the wiki, as well as provide the full extent possible by providing a link to more advanced docs over at https://connectionstrings.com/.

This feature is, for all intents and purposes, something that's more inclined towards advanced users. Anyone wanting a turnkey solution can provide the usual host/db/user/passwd combo, whereas users needing/wanting to go an extra step with their DB (notably when dealing with SSL) will already have some basic graps on connection strings.

Sure thing, I could also integrate some basic example within the code, but I sorta fail to see the benefits, as most devs dealing with databases also know what conn strings are.

Open to suggestions as always, if you want it in code, i'll add it 😌

@pacenadhif778
Copy link

Maaf kalau saya terlalu lancang, tetapi saya pikir akan lebih baik kalau semuanya dikompilasi ke dalam wiki yang tepat. Bagi amatir seperti kami, mungkin cukup membingungkan untuk menavigasi pengaturan saat ini. Wiki akan membuat panduan lebih jelas dan praktis, terutama jika menyertakan contoh dan dirancang agar dapat diakses oleh semua pengguna, terlepas dari tingkat pengalaman mereka.

Sepenuhnya setuju dengan Anda dalam hal ini. Saya berencana menambahkan beberapa contoh di wiki, dan juga menyediakan informasi selengkap mungkin dengan menyediakan tautan ke dokumen tingkat lanjut di https://connectionstrings.com/ .

Fitur ini, untuk semua maksud dan tujuan, merupakan sesuatu yang lebih condong kepada pengguna tingkat lanjut. Siapa pun yang menginginkan solusi siap pakai dapat menyediakan kombinasi host/db/pengguna/kata sandi yang biasa, sedangkan pengguna yang membutuhkan/ingin melakukan langkah ekstra dengan DB mereka (terutama saat berurusan dengan SSL) akan memiliki beberapa pemahaman dasar tentang rangkaian koneksi.

Tentu saja, saya juga dapat memadukan beberapa contoh dasar dalam kode, tetapi saya kurang dapat melihat manfaatnya, sebab sebagian besar pengembang yang menangani basis data juga mengetahui apa itu conn string.

Terbuka untuk saran seperti biasa, jika Anda menginginkannya dalam kode, saya akan menambahkannya 😌

yes of course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants