Extension talk:Cargo

From Gamepedia Help Wiki
Jump to: navigation, search

Mass delete[edit source]

Why was essentially the entire Cargo documentation deleted from Gamepedia? The idea was to have it here so people could easily access it. Sure, some bits and pieces here and there have changed since I created it all, but not very much. May as well just direct every other extension as well to Mediawiki or Wikipedia if you don't want partly duplicate content. Pangaearocks (talk) 15:24, 19 July 2019 (UTC)

Suggested usage of fields[edit source]

Working on template rewrites, and took a gander at Path of Exile Cargo tables. For text data, they tend to use String or Text, with very few instances of Page. Then I see in this newly written article:

  • Text - a large blob of text that you could NEVER EVER EVER possibly want to use in a "where" or "join" condition (more on that later!) - if in doubt, don't use this!
  • Wikitext - same thing as text, but your wikitext formatting will be preserved in queries. If you want to use this, you might want two versions of the same field, e.g. Item and Item_Markup. Use the first one to query or join, and the second one to display.

I figured one of the benefits with Cargo was precisely the use of Page for instantly linked content in auto-generated tables and suchlike, and often without the need for extra formatting in templates ([[ and ]]). But it seems like Path of Exile and this article warns against its use, implicitly. Is this due to the no html bug you mentioned, or something else? Ultimately, are we adviced to use fields such as String, Text, Integer, Float and Boolean, and restrict or avoid use of Wikitext, Wikitext string and Page? --Pangaearocks (talk) 04:27, 24 July 2019 (UTC)

Is page really not indexed? The issue is to avoid the non-indexed field types text and wikitext. If page is indexed it's fine to use. Also like I explicitly stated in the article, don't look at POE or LoL wikis and expect to find examples of "typical" Cargo use cases - both my wiki & poe use a ton of Lua, I literally don't care about pre-formatted types because I would never do a table query outside of Lua, and I'm guessing they're the same.
Also, the part you quoted even literally explains that it's fine to use text/wikitext as long as you're not querying/joining on these types, and explicitly provides the exact "workaround" to this situation you would need if you wanted to use a non-indexed field type for the purposes of markup. --RheingoldRiver (talk) 05:09, 24 July 2019 (UTC)
The query was meant as an open question about best practices, and not criticism. Some fields have changed in Cargo itself since I started using it a couple years ago, and the extension is presumably in much wider use on Gamepedia, so I simply wondered about how to best go about this.
I didn't see any info about what is indexed and not (but maybe I missed it, the mediawiki pages have a lot of info), but I would think Page fields are indexed then. I'm not skilled enough to use Lua, so will have to rely on regular queries in templates. So if there isn't a particular reason to avoid stuff like Page or Wikitext (apart from joining on the latter), then I suppose it's safe to use them after all. If Wikitext string is indexed, but not Wikitext, I can use the former instead. It's just unusual for me since it didn't exist before, so I'd need to change some stuff around. I have to re-learn much about Cargo, so am just trying to ensure I don't make too many mistakes. Excellent re-write of the article btw. Pangaearocks (talk) 13:07, 24 July 2019 (UTC)
The only two non-indexed fields are wikitext and text, that's why I mentioned those two explicitly (and I wrote this on the very next line after your quote). I didn't think you were criticizing, more that your questions are all already answered by my article so I'm not sure where the disconnect is, if you did actually read it. --RheingoldRiver (talk) 19:52, 24 July 2019 (UTC)
I elaborated on this point in the article now, hopefully this makes everything clear --RheingoldRiver (talk) 20:01, 24 July 2019 (UTC)
Not sure pokes like "if you did actually read it" are needed. I obviously did. But it's a long article, and Cargo's mediawiki articles are too, and Cargo is a complex extension and solution. I'm not a professional coder, so what is obvious to you and other pros, isn't to me and probably most others. Cheers for elaborating on it in the article, though.
I got curious about Pages, though, and since I've set up a localhost wiki, I looked it up in phpmyadmin (I'm just a regular user on the wiki I'm working on, so can't create cargo tables and the like). Image example. Regular Page fields are indexed from what I can gather (name, type). However, List (,) of Page is not. Which makes sense, really, as the actual content of e.g. ability__full is "Carnage, Corrosive Breath, Heal, Weapon Specialization" and so on.
On the other hand, Wikitext fields are not indexed, as you said. But after changing two of them to Wikitext string (damage, damage_type), they actually are indexed, because they are then given varchar(300) definition internally. Of course it would be a bad idea to join/where on these anyway (depending slightly on content), but I got curious. Pangaearocks (talk) 12:03, 25 July 2019 (UTC)

Do not put dashes in field names[edit source]

It causes more issues than it's worth. If anything that should be a disallowed character. --RheingoldRiver (talk) 04:03, 30 July 2019 (UTC)

Oh, I wasn't aware of that. What kind of problems does it cause? I only briefly tested it locally, so haven't seen the consequences yet. Pangaearocks (talk) 05:11, 30 July 2019 (UTC)
It just sometimes throws errors unless you wrap in `, and even then it kinda sucks. I don't remember any specifics because I renamed every field that has a dash in it over a year ago. --RheingoldRiver (talk) 06:12, 30 July 2019 (UTC)