Giter Site home page Giter Site logo

mysql_csharp_unity's Introduction

MySQL_CSharp_Unity

This is a CSharp and Unity library that was designed based off of sqlite-net as an example. This approach makes it clean and easy to work with MySQL from your application without many headaches. To use this library just simply add the dependencies and mysql script to your project, and you're off to the races. Below are a couple examples of working with the library.

public class Accounts
{
  [PrimaryKey, LimitKey(17)] public string SteamID;
  public bool VacBanned;
}

public class Communication
{
  private MySQL mySQL;
  
  public void Connection(string address, string user, string pass, string database)
  {
    mySQL = new MySQL();
    mySQL.Connect(address, user, pass, database);
    mySQL.CreateTable<Accounts>();
    SetupAccount("12345678901234567", false);
  }

  private void SetupAccount(string steamID, bool vacBanned)
  {
    if (mySQL.Select<Accounts>(new[] { "SteamID" }, false, new[] { steamID }).Count == 0)
      mySQL.Insert(new Accounts
      {
          SteamID = steamID,
          VacBanned = vacBanned
      });
  }
} 

Reference to Sqlite-net https://github.com/praeclarum/sqlite-net

*Note since this library was created in unity there will be sections that use Debug.Log("Message"); which will not work outside of unity. You can change these to Console.WriteLine("Message"); to produce the same result.

mysql_csharp_unity's People

Contributors

obscuredcrow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.