Stuyk

LiteDB Wrapper

Recommended Posts

What?

This is a way to manage all of your files and create basic database instances for your players / accounts / vehicles / etc.

The structure of it is really easy to work with.

All you need to do is create a class make it public and supply and integer id. Then you can add the rest. Ie.

Account.cs

public class Account
{
	public int ID { get; set; }
	public string Name { get; set; }
	public string Password { get; set; }
}

Then you can take your class instance and import it into the Database and create collections of the class type.

Adding a new 'Account' class to the Database:

Account account = new Account
{
	Name = "Stuyk",
	Password = "Test"
};

// Example Insert / Upsert into database based on the 'Account' class.
Database.Upsert(account);

Pulling Data from the Database:

Account stuykAccountData = Database.Get<Account>("Name", "Stuyk");

That's pretty much it. Really easy to work with Database for flat-file users. No bullshit SQL lines you have to write.

Github:

https://github.com/Stuyk/LiteDB-Wrapper-For-RAGE-MP/tree/master

 

YOU MUST COMPILE YOUR RESOURCES IF YOU USE THIS.

INSTALLATION INSTRUCTIONS ON GITHUB.

 

 

Edited by Stuyk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.