Skip to content

Fix for UE4.25.1 #3

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix for UE4.25.1 #3

wants to merge 4 commits into from

Conversation

RobQuistNL
Copy link

This fixed my compile errors on a UE4.25.1 build.

@RobQuistNL
Copy link
Author

I also added "CISQLite3" into the PublicDependencyModuleNames.AddRange of my project's Build.cs file;

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Json", "JsonUtilities", "CISQLite3" });

@ben-mkiv
Copy link

Wonder why i had to change way more Datatype names when fixing the compile issues
e.g.: ben-mkiv@aefe459

also changed cast to castField<>
ben-mkiv@c492091

Have you tested your changes yet, as i couldn't, so haven't made a PR yet. (also on which platform did you compile, maybe thats why i got more cmake errors)

@RobQuistNL
Copy link
Author

I have it running on my 4.25.1 Source Built - using VS17 on a Windows 10 machine.

@Squareys
Copy link
Owner

Hey everyone! @RobQuistNL @ben-mkiv

Sorry for the silence, I haven't used UE4 since half a year, since I moved to building a custom engine and am working on web based projects.

Hence, time for this is pretty limitied, but I will give this a very rough review code wise.

Best,
Jonathan

Copy link
Owner

@Squareys Squareys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some minor comments, apart from that, looks good 👍

PublicDependencyModuleNames.AddRange(
PrivatePCHHeaderFile = "Private/CISQLite3PrivatePCH.h";
PublicDependencyModuleNames.AddRange(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this indentation happened, this change seems to be whitespace only?


#include "SQLiteBlueprintFunctionLibrary.h"
#include "CISQLite3PrivatePCH.h"
#include "Engine.h"
#include "Misc/CString.h"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the PCH needs the BlueprintFunctionLibrary or why is this? 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, I'm a complete noob in UE4 and C++ 😆
I don't quite remember why, but this fixed some issues I had..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, found it. CString.h was moved to Misc/CString.h , and the order of imports was important, so they moved.

@@ -17,7 +17,7 @@ USQLiteDatabase::USQLiteDatabase(const FObjectInitializer& ObjectInitializer)

bool USQLiteDatabase::CreateDatabase(const FString& Filename, bool RelativeToProjectContentDirectory)
{
const FString actualFilename = RelativeToProjectContentDirectory ? FPaths::ProjectContentDir() + Filename : Filename;
const FString actualFilename = RelativeToProjectContentDirectory ? FPaths::ConvertRelativePathToFull(FPaths::ProjectContentDir()) + Filename : Filename;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember fighting path issues on Android, but I don't think this should be a problem.
Anyone test this on Android coincidentally? 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested on anything else but Windows, sorry. I'm not sure why I did this either, but IIRC a relative path didn't work correctly.

I'm sorry for the incredibly low quality of the MR - I just managed to make it work on my machine and decided to share ;p

Thanks for your time!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, sharing is always valuable, maybe someone using this on Android will pick it up and verify 👍

@Squareys
Copy link
Owner

For anyone landing here:

These changes fix the plugin for UE4.25.1 on Windows, tested on Windows only.
Feel free to take over and validate other platforms, then eventually this MR can be merged :)

@@ -111,6 +111,7 @@ struct SQLiteQueryResult
bool Success;
FString ErrorMessage;
TArray<SQLiteResultValue> Results;
int InsertedId = 0;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a functional change - not sure if this is the way you'd like it.. But I really needed the "last insert id" for an inserted record from a regular query (I'm only using this as a C++ module, not using the blueprints), so you might want to check that out.

Copy link
Owner

@Squareys Squareys Aug 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a SQLite (litterally, specific to sqlite) query for that SELECT last_insert_rowid(); or something. It returns the same as sqlite3_last_insert_rowid(db). (Might be slower, though).
If you could check out how that functions is implemented... if it's trivial, we can (and probably should) keep this, otherwise I recommend the query.

@RobQuistNL
Copy link
Author

@Squareys pushed some changes (and reverted the random whitespace change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants