[C++] Query builder library
Close

User Tag List

Results 1 to 3 of 3
  1. #1
    Jack Sparrow's Avatar
    Join Date
    Jul 2015
    Posts
    337
    Mentioned
    26 Post(s)
    Tagged
    8 Thread(s)

    Query builder library

    [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ]

    Query builder C++ I have been working on

    How to use example: [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ]

    At the moment there are 3 types: INSERT, REPLACE, UPDATE

    Code:
        QueryBuilder l_Builder(QueryTypes::Update, "item_template");
    
        l_Builder.AddColumn(0, DataType::Key, "entry", "1337");
        l_Builder.AddColumn(0, DataType::Key, "class", "2");
        l_Builder.AddColumn(0, DataType::None, "subclass", "7");
        l_Builder.AddColumn(0, DataType::None, "name", "Lost sword of the four gods");
        l_Builder.AddColumn(0, DataType::None, "inventorytype", "13");
        l_Builder.AddColumn(0, DataType::None, "description", "Idk a god damn description");
        l_Builder.AddColumn(0, DataType::None, "stat_type1", "3");
        l_Builder.AddColumn(0, DataType::None, "stat_value1", "3333");
    
        l_Builder.AddColumn(1, DataType::Key, "entry", "1337420");
        l_Builder.AddColumn(1, DataType::None, "class", "2");
        l_Builder.AddColumn(1, DataType::None, "subclass", "7");
        l_Builder.AddColumn(1, DataType::None, "name", "Lost sword of the fifth gods");
        l_Builder.AddColumn(1, DataType::None, "inventorytype", "17");
        l_Builder.AddColumn(1, DataType::None, "description", "Idk a god damn description LoL");
        l_Builder.AddColumn(1, DataType::None, "stat_type1", "4");
        l_Builder.AddColumn(1, DataType::None, "stat_value1", "5555");
    The params of QueryBuilder are QueryType and Table Name

    then you add columns for each row you want to insert, starting with 0 like so in the example.

    Then when you're done with that you generate the query string with l_Builder.Generate() which returns a std::string

    It's useful if you want to make something like an item creator or so.

    Example Output:


  2. # ADS
    Circuit advertisement
    Join Date
    Always
    Posts
    Many
     

  3. #2
    Lingx's Avatar
    Join Date
    Jun 2014
    Location
    :thinking:
    Posts
    416
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Good stuff

  4. #3
    Cotton Candy Randy Mr. Satan's Avatar
    Join Date
    Apr 2016
    Location
    World Martial Arts Championships
    Posts
    896
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    This is definitely very useful stuff
    Easily worth some +Rep for sure
    Have a question? Look here!:
    [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ]
    If you're question isn't already there, feel free to [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ].

    Want to donate and get VIP Access?
    Click [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ]!


    My Releases:
    [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ] | [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ]

    Quick Links:
    [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ] | [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ]
    [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ] | [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ] | [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ]

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •