For those interested, I have begun writing a blog on PureBasic development, the first series of posts detail the building of an Object-Oriented Database Layer. I am finishing up the Stand-Alone Table, and will be starting on the Parent-Child Table Structures soon.
You can find it directly here:
https://pahlabs.blogspot.com/
or via the Menu of my website:
https://www.PAHLabs.com
PureBasic Blogging
Re: PureBasic Blogging
Looked at your DB module. Very interesting. One thing that seems to be missing within Purebasic is the ability to do non-query commands, for example "CREATE DATABASE" or "ALTER TABLE". Do you have any suggestions as to how those operations might be performed from within Purebasic?
Re: PureBasic Blogging
Excellent suggestion! My base DB Module is definitely missing that.
Thank You for your input!
Pete
Thank You for your input!
Pete
Re: PureBasic Blogging
I have completed the Blog Posts on the Data-Layer
Which will complete this series of entries.
I will Include a link to download all materials, and Examples when is complete.
You can find it directly here:
https://pahlabs.blogspot.com/
or via the Menu of my website:
https://www.PAHLabs.com
- The DB Base Layer
- Stand-Alone Table
- Parent-Child Tables
Which will complete this series of entries.
I will Include a link to download all materials, and Examples when is complete.
You can find it directly here:
https://pahlabs.blogspot.com/
or via the Menu of my website:
https://www.PAHLabs.com
Re: PureBasic Blogging
Awesome work. PB needs all the tutorials it can get. Many folks (including myself) have not done any database programming in many decades and certainly would not necessarily think to use one for a game. I think part of why so many would NOT think of using a database for game, is so many gaming languages do not have native database support. This is a side of PB I have never explored before, so thank you!
Is it just me, or does Blogspot not offer a RSS feed anymore?
Is it just me, or does Blogspot not offer a RSS feed anymore?
Best wishes to the PB community. Thank you for the memories. 
Re: PureBasic Blogging
Kuron
I have no clue about the RSS feed. I'm still figuring out the Blogging!
Thanks for your kind words about the Blog!
As an Update, there are 6-7 new entries posted today. I've nearly finished this first Tutorial covering from Data-Layer thru View Code or Forms. I'm thinking the next segments will be covering Form Theming and using Custom Controls in your Projects or maybe Animated Sprites on a Windowed Screen? Whichever comes first those will be my next Topics.
You can find it directly here:
https://pahlabs.blogspot.com/
or via the Menu of my website:
https://www.PAHLabs.com
I have no clue about the RSS feed. I'm still figuring out the Blogging!
Thanks for your kind words about the Blog!
As an Update, there are 6-7 new entries posted today. I've nearly finished this first Tutorial covering from Data-Layer thru View Code or Forms. I'm thinking the next segments will be covering Form Theming and using Custom Controls in your Projects or maybe Animated Sprites on a Windowed Screen? Whichever comes first those will be my next Topics.
You can find it directly here:
https://pahlabs.blogspot.com/
or via the Menu of my website:
https://www.PAHLabs.com
Re: PureBasic Blogging
I wondered about the same!dmontaine wrote: Mon Oct 02, 2023 6:20 pm Looked at your DB module. Very interesting. One thing that seems to be missing within Purebasic is the ability to do non-query commands, for example "CREATE DATABASE" or "ALTER TABLE". Do you have any suggestions as to how those operations might be performed from within Purebasic?
This is what i do during the initialisation of a purebasic software that requires a configuration table to exist:
Code: Select all
Global.i DataBaseHandle
Procedure.i DB_CheckDatabaseUpdate(Query$, Error$ = "not set")
Define.i Result
Result = DatabaseUpdate(DataBaseHandle, Query$)
If Result = 0
Error$ = DatabaseError()
MessageRequester("Fatal error", "error opening database: " + Error + "(" + Error$ + ")")
EndIf
ProcedureReturn Result
EndProcedure
Procedure DB_InitConfiguration()
Define Result.i
Result = DatabaseQuery(DataBaseHandle, "SELECT * from configuration")
If (Result = 0)
Error$ = DatabaseError()
FinishDatabaseQuery(DataBaseHandle)
If ((FindString(Error$, "does not exist") <> 0) Or (FindString(Error$, "existiert nicht") <> 0))
DB_CheckDatabaseUpdate("CREATE TABLE configuration (uid SERIAL PRIMARY KEY, name text, path text, data bytea, wert text)")
Else
MessageRequester("Fatal error", "Initialization of the configuration table failed (" + Error$ + ")", #PB_MessageRequester_Ok | #PB_MessageRequester_Error)
End 666
EndIf
Else
FinishDatabaseQuery(DataBaseHandle)
EndIf
EndProcedure
Procedure DB_Init()
DataBaseHandle = OpenDatabase(#PB_Any, "host=localhost", #DATABASE_NAME, #DATABASE_PASSWORD)
If (DataBaseHandle = 0)
Error$ = DatabaseError()
MessageRequester("Fatal error", "Unable to open postgres database" + Chr(10) + Chr(10) + Error$, #PB_MessageRequester_Ok | #PB_MessageRequester_Error)
End 666
EndIf
EndProcedure
ps: be aware that this code only deals with the english and german language to parse error messages. Code like this should never be used in distributed software!
Re: PureBasic Blogging
Agreed. The application design IS TO Distribute the database with the product install,
The solution to my Blog Series is now available to download on my website.
BitBlazer:
I fear you are missing the point of my Series of posts. My goals here are to properly introduce, developers to Object Oriented Development. For this series of posts to include every possible condition would make it too difficult, AND way TOO LONG, for most to follow along. I am attempting to bring folks into "A" way of thinking about Programming, "A" way of Developing software, which to many would not an obvious way of writing code. To keep this LONG Series of posts focused on what "I" consider to be on topic and Not TOO Much to handle I have left out a lot. These are all things that can be dealt with after we have them on board, and thinking correctly about coding.
BitBlazer, Might I recommend you take up a Blog and introduce folks into your step-by-step approach to software development. In fact you can pick up where I left off and add your own methodology for folks to consider.
--------------------------
So for those of you who have followed along with the Blog Series, I have posted the Complete Solution on my website ready for downloading.
Blog Series is here:
https://pahlabs.blogspot.com/
Website is Here:
https://www.PAHLabs.com
The solution to my Blog Series is now available to download on my website.
BitBlazer:
I fear you are missing the point of my Series of posts. My goals here are to properly introduce, developers to Object Oriented Development. For this series of posts to include every possible condition would make it too difficult, AND way TOO LONG, for most to follow along. I am attempting to bring folks into "A" way of thinking about Programming, "A" way of Developing software, which to many would not an obvious way of writing code. To keep this LONG Series of posts focused on what "I" consider to be on topic and Not TOO Much to handle I have left out a lot. These are all things that can be dealt with after we have them on board, and thinking correctly about coding.
BitBlazer, Might I recommend you take up a Blog and introduce folks into your step-by-step approach to software development. In fact you can pick up where I left off and add your own methodology for folks to consider.
--------------------------
So for those of you who have followed along with the Blog Series, I have posted the Complete Solution on my website ready for downloading.
Blog Series is here:
https://pahlabs.blogspot.com/
Website is Here:
https://www.PAHLabs.com