How to implement D to HTML pages ?

rjframe dlang at ryanjframe.com
Mon Oct 1 23:17:59 UTC 2018


On Mon, 01 Oct 2018 19:29:56 +0000, Aurélien Plazzotta wrote:
On Mon, 01 Oct 2018 19:29:56 +0000, Aurélien Plazzotta wrote:

> Hello guys,
> 
> I would like to implement a forum and a blog within my website
> (currently including only HTML, CSS and JS, written without CMS), using
> D and SQL but I really don't know how to proceed. How can I integrate D
> into HTML pages? Are there any kind of include's commands like PHP ?
> 
> Also, do I have to use vibe.d ? Or is it optional? I admit I didn't read
> the book yet (D Web Development), but only "Programming in D", which
> doesn't deal much with website workflow.

If you're most comfortable with PHP you may want to look at Adam Ruppe's 
arsd[0]; the readme has an overview of web-related and database-related 
modules.

vibe.d has more of a node.js feel. There's also DiamondMVC[1], which 
reminds me of ASP.NET (I'm not 100% sure whether that's intentional, and I 
haven't tried Diamond) and includes an ORM.


> Finally, what database system do you recommand to interact with for
> data-oriented website purpose? Perhaps, there are some standard or
> tierce-party librairies or ORM for PostgreSQL or SQLite ?
> 
> Thanks for all the light anyone will be willing to spread :)

There are low-level bindings for MySQL/MariaDB, Postgres, SqLite, and some 
people have made higher-level libraries and ORMs[2]. You may want to 
browse a bit and see what you like. I believe the Diamond ORM can be used 
without the rest of the framework, and the hunt-entity ORM is actively 
developed.


[0]: Repo: https://github.com/adamdruppe/arsd
     Docs: https://arsd-official.dpldocs.info/index.html (note that not 
everything is documented)
[1]: https://github.com/DiamondMVC/Diamond
[2]: http://code.dlang.org/?sort=updated&limit=20&category=library.database


More information about the Digitalmars-d-learn mailing list